home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: libstdwin.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [R*ch] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 53 54 44 57 49 4e 20 |\chapter|{STDWIN |
|00000010| 4f 4e 4c 59 7d 0d 0d 5c | 73 65 63 74 69 6f 6e 7b |ONLY}..\|section{|
|00000020| 42 75 69 6c 74 2d 69 6e | 20 4d 6f 64 75 6c 65 20 |Built-in| Module |
|00000030| 5c 73 65 63 74 63 6f 64 | 65 7b 73 74 64 77 69 6e |\sectcod|e{stdwin|
|00000040| 7d 7d 0d 5c 62 69 6d 6f | 64 69 6e 64 65 78 7b 73 |}}.\bimo|dindex{s|
|00000050| 74 64 77 69 6e 7d 0d 0d | 54 68 69 73 20 6d 6f 64 |tdwin}..|This mod|
|00000060| 75 6c 65 20 64 65 66 69 | 6e 65 73 20 73 65 76 65 |ule defi|nes seve|
|00000070| 72 61 6c 20 6e 65 77 20 | 6f 62 6a 65 63 74 20 74 |ral new |object t|
|00000080| 79 70 65 73 20 61 6e 64 | 20 66 75 6e 63 74 69 6f |ypes and| functio|
|00000090| 6e 73 20 74 68 61 74 0d | 70 72 6f 76 69 64 65 20 |ns that.|provide |
|000000a0| 61 63 63 65 73 73 20 74 | 6f 20 74 68 65 20 66 75 |access t|o the fu|
|000000b0| 6e 63 74 69 6f 6e 61 6c | 69 74 79 20 6f 66 20 74 |nctional|ity of t|
|000000c0| 68 65 20 53 74 61 6e 64 | 61 72 64 20 57 69 6e 64 |he Stand|ard Wind|
|000000d0| 6f 77 20 53 79 73 74 65 | 6d 0d 49 6e 74 65 72 66 |ow Syste|m.Interf|
|000000e0| 61 63 65 2c 20 53 54 44 | 57 49 4e 20 5b 43 57 49 |ace, STD|WIN [CWI|
|000000f0| 20 72 65 70 6f 72 74 20 | 43 52 2d 52 38 38 31 37 | report |CR-R8817|
|00000100| 5d 2e 0d 49 74 20 69 73 | 20 61 76 61 69 6c 61 62 |]..It is| availab|
|00000110| 6c 65 20 6f 6e 20 73 79 | 73 74 65 6d 73 20 74 6f |le on sy|stems to|
|00000120| 20 77 68 69 63 68 20 53 | 54 44 57 49 4e 20 68 61 | which S|TDWIN ha|
|00000130| 73 20 62 65 65 6e 20 70 | 6f 72 74 65 64 20 28 77 |s been p|orted (w|
|00000140| 68 69 63 68 20 69 73 0d | 6d 6f 73 74 20 73 79 73 |hich is.|most sys|
|00000150| 74 65 6d 73 29 2e 0d 49 | 74 20 69 73 20 6f 6e 6c |tems)..I|t is onl|
|00000160| 79 20 61 76 61 69 6c 61 | 62 6c 65 20 69 66 20 74 |y availa|ble if t|
|00000170| 68 65 20 5c 63 6f 64 65 | 7b 44 49 53 50 4c 41 59 |he \code|{DISPLAY|
|00000180| 7d 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 76 61 |} enviro|nment va|
|00000190| 72 69 61 62 6c 65 20 69 | 73 20 73 65 74 0d 6f 72 |riable i|s set.or|
|000001a0| 20 61 6e 20 65 78 70 6c | 69 63 69 74 20 5c 73 61 | an expl|icit \sa|
|000001b0| 6d 70 7b 2d 64 69 73 70 | 6c 61 79 20 5c 76 61 72 |mp{-disp|lay \var|
|000001c0| 7b 64 69 73 70 6c 61 79 | 6e 61 6d 65 7d 7d 20 61 |{display|name}} a|
|000001d0| 72 67 75 6d 65 6e 74 20 | 69 73 20 70 61 73 73 65 |rgument |is passe|
|000001e0| 64 20 74 6f 0d 74 68 65 | 20 69 6e 74 65 72 70 72 |d to.the| interpr|
|000001f0| 65 74 65 72 2e 0d 0d 46 | 75 6e 63 74 69 6f 6e 73 |eter...F|unctions|
|00000200| 20 68 61 76 65 20 6e 61 | 6d 65 73 20 74 68 61 74 | have na|mes that|
|00000210| 20 75 73 75 61 6c 6c 79 | 20 72 65 73 65 6d 62 6c | usually| resembl|
|00000220| 65 20 74 68 65 69 72 20 | 43 20 53 54 44 57 49 4e |e their |C STDWIN|
|00000230| 20 63 6f 75 6e 74 65 72 | 70 61 72 74 73 0d 77 69 | counter|parts.wi|
|00000240| 74 68 20 74 68 65 20 69 | 6e 69 74 69 61 6c 20 60 |th the i|nitial `|
|00000250| 77 27 20 64 72 6f 70 70 | 65 64 2e 0d 50 6f 69 6e |w' dropp|ed..Poin|
|00000260| 74 73 20 61 72 65 20 72 | 65 70 72 65 73 65 6e 74 |ts are r|epresent|
|00000270| 65 64 20 62 79 20 70 61 | 69 72 73 20 6f 66 20 69 |ed by pa|irs of i|
|00000280| 6e 74 65 67 65 72 73 3b | 20 72 65 63 74 61 6e 67 |ntegers;| rectang|
|00000290| 6c 65 73 0d 62 79 20 70 | 61 69 72 73 20 6f 66 20 |les.by p|airs of |
|000002a0| 70 6f 69 6e 74 73 2e 0d | 46 6f 72 20 61 20 63 6f |points..|For a co|
|000002b0| 6d 70 6c 65 74 65 20 64 | 65 73 63 72 69 70 74 69 |mplete d|escripti|
|000002c0| 6f 6e 20 6f 66 20 53 54 | 44 57 49 4e 20 70 6c 65 |on of ST|DWIN ple|
|000002d0| 61 73 65 20 72 65 66 65 | 72 20 74 6f 20 74 68 65 |ase refe|r to the|
|000002e0| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 0d 6f | documen|tation.o|
|000002f0| 66 20 53 54 44 57 49 4e | 20 66 6f 72 20 43 20 70 |f STDWIN| for C p|
|00000300| 72 6f 67 72 61 6d 6d 65 | 72 73 20 28 61 66 6f 72 |rogramme|rs (afor|
|00000310| 65 6d 65 6e 74 69 6f 6e | 65 64 20 43 57 49 20 72 |emention|ed CWI r|
|00000320| 65 70 6f 72 74 29 2e 0d | 0d 5c 73 75 62 73 65 63 |eport)..|.\subsec|
|00000330| 74 69 6f 6e 7b 46 75 6e | 63 74 69 6f 6e 73 20 44 |tion{Fun|ctions D|
|00000340| 65 66 69 6e 65 64 20 69 | 6e 20 4d 6f 64 75 6c 65 |efined i|n Module|
|00000350| 20 5c 73 65 63 74 63 6f | 64 65 7b 73 74 64 77 69 | \sectco|de{stdwi|
|00000360| 6e 7d 7d 0d 0d 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |n}}..The| followi|
|00000370| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 |ng funct|ions are|
|00000380| 20 64 65 66 69 6e 65 64 | 20 69 6e 20 74 68 65 20 | defined| in the |
|00000390| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 7d 20 6d 6f |\code{st|dwin} mo|
|000003a0| 64 75 6c 65 3a 0d 0d 5c | 72 65 6e 65 77 63 6f 6d |dule:..\|renewcom|
|000003b0| 6d 61 6e 64 7b 5c 69 6e | 64 65 78 73 75 62 69 74 |mand{\in|dexsubit|
|000003c0| 65 6d 7d 7b 28 69 6e 20 | 6d 6f 64 75 6c 65 20 73 |em}{(in |module s|
|000003d0| 74 64 77 69 6e 29 7d 0d | 5c 62 65 67 69 6e 7b 66 |tdwin)}.|\begin{f|
|000003e0| 75 6e 63 64 65 73 63 7d | 7b 6f 70 65 6e 7d 7b 74 |uncdesc}|{open}{t|
|000003f0| 69 74 6c 65 7d 0d 4f 70 | 65 6e 20 61 20 6e 65 77 |itle}.Op|en a new|
|00000400| 20 77 69 6e 64 6f 77 20 | 77 68 6f 73 65 20 69 6e | window |whose in|
|00000410| 69 74 69 61 6c 20 74 69 | 74 6c 65 20 69 73 20 67 |itial ti|tle is g|
|00000420| 69 76 65 6e 20 62 79 20 | 74 68 65 20 73 74 72 69 |iven by |the stri|
|00000430| 6e 67 20 61 72 67 75 6d | 65 6e 74 2e 0d 52 65 74 |ng argum|ent..Ret|
|00000440| 75 72 6e 20 61 20 77 69 | 6e 64 6f 77 20 6f 62 6a |urn a wi|ndow obj|
|00000450| 65 63 74 3b 20 77 69 6e | 64 6f 77 20 6f 62 6a 65 |ect; win|dow obje|
|00000460| 63 74 20 6d 65 74 68 6f | 64 73 20 61 72 65 20 64 |ct metho|ds are d|
|00000470| 65 73 63 72 69 62 65 64 | 20 62 65 6c 6f 77 2e 25 |escribed| below.%|
|00000480| 0d 5c 66 6f 6f 74 6e 6f | 74 65 7b 54 68 65 20 50 |.\footno|te{The P|
|00000490| 79 74 68 6f 6e 20 76 65 | 72 73 69 6f 6e 20 6f 66 |ython ve|rsion of|
|000004a0| 20 53 54 44 57 49 4e 20 | 64 6f 65 73 20 6e 6f 74 | STDWIN |does not|
|000004b0| 20 73 75 70 70 6f 72 74 | 20 64 72 61 77 20 70 72 | support| draw pr|
|000004c0| 6f 63 65 64 75 72 65 73 | 3b 20 61 6c 6c 0d 09 64 |ocedures|; all..d|
|000004d0| 72 61 77 69 6e 67 20 72 | 65 71 75 65 73 74 73 20 |rawing r|equests |
|000004e0| 61 72 65 20 72 65 70 6f | 72 74 65 64 20 61 73 20 |are repo|rted as |
|000004f0| 64 72 61 77 20 65 76 65 | 6e 74 73 2e 7d 0d 5c 65 |draw eve|nts.}.\e|
|00000500| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|00000510| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|00000520| 65 74 65 76 65 6e 74 7d | 7b 7d 0d 57 61 69 74 20 |etevent}|{}.Wait |
|00000530| 66 6f 72 20 61 6e 64 20 | 72 65 74 75 72 6e 20 74 |for and |return t|
|00000540| 68 65 20 6e 65 78 74 20 | 65 76 65 6e 74 2e 0d 41 |he next |event..A|
|00000550| 6e 20 65 76 65 6e 74 20 | 69 73 20 72 65 74 75 72 |n event |is retur|
|00000560| 6e 65 64 20 61 73 20 61 | 20 74 72 69 70 6c 65 3a |ned as a| triple:|
|00000570| 20 74 68 65 20 66 69 72 | 73 74 20 65 6c 65 6d 65 | the fir|st eleme|
|00000580| 6e 74 20 69 73 20 74 68 | 65 20 65 76 65 6e 74 0d |nt is th|e event.|
|00000590| 74 79 70 65 2c 20 61 20 | 73 6d 61 6c 6c 20 69 6e |type, a |small in|
|000005a0| 74 65 67 65 72 3b 20 74 | 68 65 20 73 65 63 6f 6e |teger; t|he secon|
|000005b0| 64 20 65 6c 65 6d 65 6e | 74 20 69 73 20 74 68 65 |d elemen|t is the|
|000005c0| 20 77 69 6e 64 6f 77 20 | 6f 62 6a 65 63 74 20 74 | window |object t|
|000005d0| 6f 20 77 68 69 63 68 0d | 74 68 65 20 65 76 65 6e |o which.|the even|
|000005e0| 74 20 61 70 70 6c 69 65 | 73 2c 20 6f 72 0d 5c 63 |t applie|s, or.\c|
|000005f0| 6f 64 65 7b 4e 6f 6e 65 | 7d 0d 69 66 20 69 74 20 |ode{None|}.if it |
|00000600| 61 70 70 6c 69 65 73 20 | 74 6f 20 6e 6f 20 77 69 |applies |to no wi|
|00000610| 6e 64 6f 77 20 69 6e 20 | 70 61 72 74 69 63 75 6c |ndow in |particul|
|00000620| 61 72 3b 0d 74 68 65 20 | 74 68 69 72 64 20 65 6c |ar;.the |third el|
|00000630| 65 6d 65 6e 74 20 69 73 | 20 74 79 70 65 2d 64 65 |ement is| type-de|
|00000640| 70 65 6e 64 65 6e 74 2e | 0d 4e 61 6d 65 73 20 66 |pendent.|.Names f|
|00000650| 6f 72 20 65 76 65 6e 74 | 20 74 79 70 65 73 20 61 |or event| types a|
|00000660| 6e 64 20 63 6f 6d 6d 61 | 6e 64 20 63 6f 64 65 73 |nd comma|nd codes|
|00000670| 20 61 72 65 20 64 65 66 | 69 6e 65 64 20 69 6e 20 | are def|ined in |
|00000680| 74 68 65 20 73 74 61 6e | 64 61 72 64 0d 6d 6f 64 |the stan|dard.mod|
|00000690| 75 6c 65 0d 5c 63 6f 64 | 65 7b 73 74 64 77 69 6e |ule.\cod|e{stdwin|
|000006a0| 65 76 65 6e 74 7d 2e 0d | 5c 65 6e 64 7b 66 75 6e |event}..|\end{fun|
|000006b0| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|000006c0| 75 6e 63 64 65 73 63 7d | 7b 70 6f 6c 6c 65 76 65 |uncdesc}|{polleve|
|000006d0| 6e 74 7d 7b 7d 0d 52 65 | 74 75 72 6e 20 74 68 65 |nt}{}.Re|turn the|
|000006e0| 20 6e 65 78 74 20 65 76 | 65 6e 74 2c 20 69 66 20 | next ev|ent, if |
|000006f0| 6f 6e 65 20 69 73 20 69 | 6d 6d 65 64 69 61 74 65 |one is i|mmediate|
|00000700| 6c 79 20 61 76 61 69 6c | 61 62 6c 65 2e 0d 49 66 |ly avail|able..If|
|00000710| 20 6e 6f 20 65 76 65 6e | 74 20 69 73 20 61 76 61 | no even|t is ava|
|00000720| 69 6c 61 62 6c 65 2c 20 | 72 65 74 75 72 6e 20 5c |ilable, |return \|
|00000730| 63 6f 64 65 7b 28 29 7d | 2e 0d 5c 65 6e 64 7b 66 |code{()}|..\end{f|
|00000740| 75 6e 63 64 65 73 63 7d | 0d 0d 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00000750| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 65 74 61 63 |{funcdes|c}{getac|
|00000760| 74 69 76 65 7d 7b 7d 0d | 52 65 74 75 72 6e 20 74 |tive}{}.|Return t|
|00000770| 68 65 20 77 69 6e 64 6f | 77 20 74 68 61 74 20 69 |he windo|w that i|
|00000780| 73 20 63 75 72 72 65 6e | 74 6c 79 20 61 63 74 69 |s curren|tly acti|
|00000790| 76 65 2c 20 6f 72 20 5c | 63 6f 64 65 7b 4e 6f 6e |ve, or \|code{Non|
|000007a0| 65 7d 20 69 66 20 6e 6f | 0d 77 69 6e 64 6f 77 20 |e} if no|.window |
|000007b0| 69 73 20 63 75 72 72 65 | 6e 74 6c 79 20 61 63 74 |is curre|ntly act|
|000007c0| 69 76 65 2e 20 20 28 54 | 68 69 73 20 63 61 6e 20 |ive. (T|his can |
|000007d0| 62 65 20 65 6d 75 6c 61 | 74 65 64 20 62 79 20 6d |be emula|ted by m|
|000007e0| 6f 6e 69 74 6f 72 69 6e | 67 0d 57 45 5f 41 43 54 |onitorin|g.WE_ACT|
|000007f0| 49 56 41 54 45 20 61 6e | 64 20 57 45 5f 44 45 41 |IVATE an|d WE_DEA|
|00000800| 43 54 49 56 41 54 45 20 | 65 76 65 6e 74 73 2e 29 |CTIVATE |events.)|
|00000810| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00000820| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000830| 7d 7b 6c 69 73 74 66 6f | 6e 74 6e 61 6d 65 73 7d |}{listfo|ntnames}|
|00000840| 7b 70 61 74 74 65 72 6e | 7d 0d 52 65 74 75 72 6e |{pattern|}.Return|
|00000850| 20 74 68 65 20 6c 69 73 | 74 20 6f 66 20 66 6f 6e | the lis|t of fon|
|00000860| 74 20 6e 61 6d 65 73 20 | 69 6e 20 74 68 65 20 73 |t names |in the s|
|00000870| 79 73 74 65 6d 20 74 68 | 61 74 20 6d 61 74 63 68 |ystem th|at match|
|00000880| 20 74 68 65 20 70 61 74 | 74 65 72 6e 20 28 61 0d | the pat|tern (a.|
|00000890| 73 74 72 69 6e 67 29 2e | 20 20 54 68 65 20 70 61 |string).| The pa|
|000008a0| 74 74 65 72 6e 20 73 68 | 6f 75 6c 64 20 6e 6f 72 |ttern sh|ould nor|
|000008b0| 6d 61 6c 6c 79 20 62 65 | 20 5c 63 6f 64 65 7b 27 |mally be| \code{'|
|000008c0| 2a 27 7d 3b 20 72 65 74 | 75 72 6e 73 20 61 6c 6c |*'}; ret|urns all|
|000008d0| 0d 61 76 61 69 6c 61 62 | 6c 65 20 66 6f 6e 74 73 |.availab|le fonts|
|000008e0| 2e 20 20 49 66 20 74 68 | 65 20 75 6e 64 65 72 6c |. If th|e underl|
|000008f0| 79 69 6e 67 20 77 69 6e | 64 6f 77 20 73 79 73 74 |ying win|dow syst|
|00000900| 65 6d 20 69 73 20 58 31 | 31 2c 20 6f 74 68 65 72 |em is X1|1, other|
|00000910| 0d 70 61 74 74 65 72 6e | 73 20 66 6f 6c 6c 6f 77 |.pattern|s follow|
|00000920| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 58 31 | the sta|ndard X1|
|00000930| 31 20 66 6f 6e 74 20 73 | 65 6c 65 63 74 69 6f 6e |1 font s|election|
|00000940| 20 73 79 6e 74 61 78 20 | 28 61 73 20 75 73 65 64 | syntax |(as used|
|00000950| 20 65 2e 67 2e 0d 69 6e | 20 72 65 73 6f 75 72 63 | e.g..in| resourc|
|00000960| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 73 29 2c 20 |e defini|tions), |
|00000970| 69 2e 65 2e 20 74 68 65 | 20 77 69 6c 64 63 61 72 |i.e. the| wildcar|
|00000980| 64 20 63 68 61 72 61 63 | 74 65 72 20 5c 63 6f 64 |d charac|ter \cod|
|00000990| 65 7b 27 2a 27 7d 0d 6d | 61 74 63 68 65 73 20 61 |e{'*'}.m|atches a|
|000009a0| 6e 79 20 73 65 71 75 65 | 6e 63 65 20 6f 66 20 63 |ny seque|nce of c|
|000009b0| 68 61 72 61 63 74 65 72 | 73 20 28 69 6e 63 6c 75 |haracter|s (inclu|
|000009c0| 64 69 6e 67 20 6e 6f 6e | 65 29 20 61 6e 64 20 5c |ding non|e) and \|
|000009d0| 63 6f 64 65 7b 27 3f 27 | 7d 0d 6d 61 74 63 68 65 |code{'?'|}.matche|
|000009e0| 73 20 61 6e 79 20 73 69 | 6e 67 6c 65 20 63 68 61 |s any si|ngle cha|
|000009f0| 72 61 63 74 65 72 2e 0d | 5c 65 6e 64 7b 66 75 6e |racter..|\end{fun|
|00000a00| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00000a10| 75 6e 63 64 65 73 63 7d | 7b 73 65 74 64 65 66 73 |uncdesc}|{setdefs|
|00000a20| 63 72 6f 6c 6c 62 61 72 | 73 7d 7b 68 66 6c 61 67 |crollbar|s}{hflag|
|00000a30| 5c 2c 20 76 66 6c 61 67 | 7d 0d 53 65 74 20 74 68 |\, vflag|}.Set th|
|00000a40| 65 20 66 6c 61 67 73 20 | 63 6f 6e 74 72 6f 6c 6c |e flags |controll|
|00000a50| 69 6e 67 20 77 68 65 74 | 68 65 72 20 73 75 62 73 |ing whet|her subs|
|00000a60| 65 71 75 65 6e 74 6c 79 | 20 6f 70 65 6e 65 64 20 |equently| opened |
|00000a70| 77 69 6e 64 6f 77 73 20 | 77 69 6c 6c 0d 68 61 76 |windows |will.hav|
|00000a80| 65 20 68 6f 72 69 7a 6f | 6e 74 61 6c 20 61 6e 64 |e horizo|ntal and|
|00000a90| 2f 6f 72 20 76 65 72 74 | 69 63 61 6c 20 73 63 72 |/or vert|ical scr|
|00000aa0| 6f 6c 6c 20 62 61 72 73 | 2e 0d 5c 65 6e 64 7b 66 |oll bars|..\end{f|
|00000ab0| 75 6e 63 64 65 73 63 7d | 0d 0d 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00000ac0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 73 65 74 64 65 |{funcdes|c}{setde|
|00000ad0| 66 77 69 6e 70 6f 73 7d | 7b 68 5c 2c 20 76 7d 0d |fwinpos}|{h\, v}.|
|00000ae0| 53 65 74 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |Set the |default |
|00000af0| 77 69 6e 64 6f 77 20 70 | 6f 73 69 74 69 6f 6e 20 |window p|osition |
|00000b00| 66 6f 72 20 77 69 6e 64 | 6f 77 73 20 6f 70 65 6e |for wind|ows open|
|00000b10| 65 64 20 73 75 62 73 65 | 71 75 65 6e 74 6c 79 2e |ed subse|quently.|
|00000b20| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00000b30| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000b40| 7d 7b 73 65 74 64 65 66 | 77 69 6e 73 69 7a 65 7d |}{setdef|winsize}|
|00000b50| 7b 77 69 64 74 68 5c 2c | 20 68 65 69 67 68 74 7d |{width\,| height}|
|00000b60| 0d 53 65 74 20 74 68 65 | 20 64 65 66 61 75 6c 74 |.Set the| default|
|00000b70| 20 77 69 6e 64 6f 77 20 | 73 69 7a 65 20 66 6f 72 | window |size for|
|00000b80| 20 77 69 6e 64 6f 77 73 | 20 6f 70 65 6e 65 64 20 | windows| opened |
|00000b90| 73 75 62 73 65 71 75 65 | 6e 74 6c 79 2e 0d 5c 65 |subseque|ntly..\e|
|00000ba0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|00000bb0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|00000bc0| 65 74 64 65 66 73 63 72 | 6f 6c 6c 62 61 72 73 7d |etdefscr|ollbars}|
|00000bd0| 7b 7d 0d 52 65 74 75 72 | 6e 20 74 68 65 20 66 6c |{}.Retur|n the fl|
|00000be0| 61 67 73 20 63 6f 6e 74 | 72 6f 6c 6c 69 6e 67 20 |ags cont|rolling |
|00000bf0| 77 68 65 74 68 65 72 20 | 73 75 62 73 65 71 75 65 |whether |subseque|
|00000c00| 6e 74 6c 79 20 6f 70 65 | 6e 65 64 20 77 69 6e 64 |ntly ope|ned wind|
|00000c10| 6f 77 73 20 77 69 6c 6c | 0d 68 61 76 65 20 68 6f |ows will|.have ho|
|00000c20| 72 69 7a 6f 6e 74 61 6c | 20 61 6e 64 2f 6f 72 20 |rizontal| and/or |
|00000c30| 76 65 72 74 69 63 61 6c | 20 73 63 72 6f 6c 6c 20 |vertical| scroll |
|00000c40| 62 61 72 73 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |bars..\e|nd{funcd|
|00000c50| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00000c60| 63 64 65 73 63 7d 7b 67 | 65 74 64 65 66 77 69 6e |cdesc}{g|etdefwin|
|00000c70| 70 6f 73 7d 7b 7d 0d 52 | 65 74 75 72 6e 20 74 68 |pos}{}.R|eturn th|
|00000c80| 65 20 64 65 66 61 75 6c | 74 20 77 69 6e 64 6f 77 |e defaul|t window|
|00000c90| 20 70 6f 73 69 74 69 6f | 6e 20 66 6f 72 20 77 69 | positio|n for wi|
|00000ca0| 6e 64 6f 77 73 20 6f 70 | 65 6e 65 64 20 73 75 62 |ndows op|ened sub|
|00000cb0| 73 65 71 75 65 6e 74 6c | 79 2e 0d 5c 65 6e 64 7b |sequentl|y..\end{|
|00000cc0| 66 75 6e 63 64 65 73 63 | 7d 0d 0d 5c 62 65 67 69 |funcdesc|}..\begi|
|00000cd0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 67 65 74 64 |n{funcde|sc}{getd|
|00000ce0| 65 66 77 69 6e 73 69 7a | 65 7d 7b 7d 0d 52 65 74 |efwinsiz|e}{}.Ret|
|00000cf0| 75 72 6e 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |urn the |default |
|00000d00| 77 69 6e 64 6f 77 20 73 | 69 7a 65 20 66 6f 72 20 |window s|ize for |
|00000d10| 77 69 6e 64 6f 77 73 20 | 6f 70 65 6e 65 64 20 73 |windows |opened s|
|00000d20| 75 62 73 65 71 75 65 6e | 74 6c 79 2e 0d 5c 65 6e |ubsequen|tly..\en|
|00000d30| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00000d40| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 67 65 |gin{func|desc}{ge|
|00000d50| 74 73 63 72 73 69 7a 65 | 7d 7b 7d 0d 52 65 74 75 |tscrsize|}{}.Retu|
|00000d60| 72 6e 20 74 68 65 20 73 | 63 72 65 65 6e 20 73 69 |rn the s|creen si|
|00000d70| 7a 65 20 69 6e 20 70 69 | 78 65 6c 73 2e 0d 5c 65 |ze in pi|xels..\e|
|00000d80| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|00000d90| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|00000da0| 65 74 73 63 72 6d 6d 7d | 7b 7d 0d 52 65 74 75 72 |etscrmm}|{}.Retur|
|00000db0| 6e 20 74 68 65 20 73 63 | 72 65 65 6e 20 73 69 7a |n the sc|reen siz|
|00000dc0| 65 20 69 6e 20 6d 69 6c | 6c 69 6d 65 74 65 72 73 |e in mil|limeters|
|00000dd0| 2e 0d 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00000de0| 0d 0d 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00000df0| 63 7d 7b 66 65 74 63 68 | 63 6f 6c 6f 72 7d 7b 63 |c}{fetch|color}{c|
|00000e00| 6f 6c 6f 72 6e 61 6d 65 | 7d 0d 52 65 74 75 72 6e |olorname|}.Return|
|00000e10| 20 74 68 65 20 70 69 78 | 65 6c 20 76 61 6c 75 65 | the pix|el value|
|00000e20| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 74 | corresp|onding t|
|00000e30| 6f 20 74 68 65 20 67 69 | 76 65 6e 20 63 6f 6c 6f |o the gi|ven colo|
|00000e40| 72 20 6e 61 6d 65 2e 0d | 52 65 74 75 72 6e 20 74 |r name..|Return t|
|00000e50| 68 65 20 64 65 66 61 75 | 6c 74 20 66 6f 72 65 67 |he defau|lt foreg|
|00000e60| 72 6f 75 6e 64 20 63 6f | 6c 6f 72 20 66 6f 72 20 |round co|lor for |
|00000e70| 75 6e 6b 6e 6f 77 6e 20 | 63 6f 6c 6f 72 20 6e 61 |unknown |color na|
|00000e80| 6d 65 73 2e 0d 48 69 6e | 74 3a 20 74 68 65 20 66 |mes..Hin|t: the f|
|00000e90| 6f 6c 6c 6f 77 69 6e 67 | 20 63 6f 64 65 20 74 65 |ollowing| code te|
|00000ea0| 73 74 73 20 77 68 65 74 | 68 65 72 20 79 6f 75 20 |sts whet|her you |
|00000eb0| 61 72 65 20 6f 6e 20 61 | 20 6d 61 63 68 69 6e 65 |are on a| machine|
|00000ec0| 20 74 68 61 74 0d 73 75 | 70 70 6f 72 74 73 20 6d | that.su|pports m|
|00000ed0| 6f 72 65 20 74 68 61 6e | 20 74 77 6f 20 63 6f 6c |ore than| two col|
|00000ee0| 6f 72 73 3a 0d 5c 62 63 | 6f 64 65 5c 62 65 67 69 |ors:.\bc|ode\begi|
|00000ef0| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0d 69 66 20 73 |n{verbat|im}.if s|
|00000f00| 74 64 77 69 6e 2e 66 65 | 74 63 68 63 6f 6c 6f 72 |tdwin.fe|tchcolor|
|00000f10| 28 27 62 6c 61 63 6b 27 | 29 20 3c 3e 20 5c 0d 20 |('black'|) <> \. |
|00000f20| 20 20 20 20 20 20 20 20 | 20 73 74 64 77 69 6e 2e | | stdwin.|
|00000f30| 66 65 74 63 68 63 6f 6c | 6f 72 28 27 72 65 64 27 |fetchcol|or('red'|
|00000f40| 29 20 3c 3e 20 5c 0d 20 | 20 20 20 20 20 20 20 20 |) <> \. | |
|00000f50| 20 73 74 64 77 69 6e 2e | 66 65 74 63 68 63 6f 6c | stdwin.|fetchcol|
|00000f60| 6f 72 28 27 77 68 69 74 | 65 27 29 3a 0d 20 20 20 |or('whit|e'):. |
|00000f70| 20 70 72 69 6e 74 20 27 | 63 6f 6c 6f 72 20 6d 61 | print '|color ma|
|00000f80| 63 68 69 6e 65 27 0d 65 | 6c 73 65 3a 0d 20 20 20 |chine'.e|lse:. |
|00000f90| 20 70 72 69 6e 74 20 27 | 6d 6f 6e 6f 63 68 72 6f | print '|monochro|
|00000fa0| 6d 65 20 6d 61 63 68 69 | 6e 65 27 0d 5c 65 6e 64 |me machi|ne'.\end|
|00000fb0| 7b 76 65 72 62 61 74 69 | 6d 7d 5c 65 63 6f 64 65 |{verbati|m}\ecode|
|00000fc0| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00000fd0| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000fe0| 7d 7b 73 65 74 66 67 63 | 6f 6c 6f 72 7d 7b 70 69 |}{setfgc|olor}{pi|
|00000ff0| 78 65 6c 7d 0d 53 65 74 | 20 74 68 65 20 64 65 66 |xel}.Set| the def|
|00001000| 61 75 6c 74 20 66 6f 72 | 65 67 72 6f 75 6e 64 20 |ault for|eground |
|00001010| 63 6f 6c 6f 72 2e 0d 54 | 68 69 73 20 77 69 6c 6c |color..T|his will|
|00001020| 20 62 65 63 6f 6d 65 20 | 74 68 65 20 64 65 66 61 | become |the defa|
|00001030| 75 6c 74 20 66 6f 72 65 | 67 72 6f 75 6e 64 20 63 |ult fore|ground c|
|00001040| 6f 6c 6f 72 20 6f 66 20 | 77 69 6e 64 6f 77 73 20 |olor of |windows |
|00001050| 6f 70 65 6e 65 64 0d 73 | 75 62 73 65 71 75 65 6e |opened.s|ubsequen|
|00001060| 74 6c 79 2c 20 69 6e 63 | 6c 75 64 69 6e 67 20 64 |tly, inc|luding d|
|00001070| 69 61 6c 6f 67 73 2e 0d | 5c 65 6e 64 7b 66 75 6e |ialogs..|\end{fun|
|00001080| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00001090| 75 6e 63 64 65 73 63 7d | 7b 73 65 74 62 67 63 6f |uncdesc}|{setbgco|
|000010a0| 6c 6f 72 7d 7b 70 69 78 | 65 6c 7d 0d 53 65 74 20 |lor}{pix|el}.Set |
|000010b0| 74 68 65 20 64 65 66 61 | 75 6c 74 20 62 61 63 6b |the defa|ult back|
|000010c0| 67 72 6f 75 6e 64 20 63 | 6f 6c 6f 72 2e 0d 54 68 |ground c|olor..Th|
|000010d0| 69 73 20 77 69 6c 6c 20 | 62 65 63 6f 6d 65 20 74 |is will |become t|
|000010e0| 68 65 20 64 65 66 61 75 | 6c 74 20 62 61 63 6b 67 |he defau|lt backg|
|000010f0| 72 6f 75 6e 64 20 63 6f | 6c 6f 72 20 6f 66 20 77 |round co|lor of w|
|00001100| 69 6e 64 6f 77 73 20 6f | 70 65 6e 65 64 0d 73 75 |indows o|pened.su|
|00001110| 62 73 65 71 75 65 6e 74 | 6c 79 2c 20 69 6e 63 6c |bsequent|ly, incl|
|00001120| 75 64 69 6e 67 20 64 69 | 61 6c 6f 67 73 2e 0d 5c |uding di|alogs..\|
|00001130| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00001140| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00001150| 67 65 74 66 67 63 6f 6c | 6f 72 7d 7b 7d 0d 52 65 |getfgcol|or}{}.Re|
|00001160| 74 75 72 6e 20 74 68 65 | 20 70 69 78 65 6c 20 76 |turn the| pixel v|
|00001170| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 63 75 72 72 |alue of |the curr|
|00001180| 65 6e 74 20 64 65 66 61 | 75 6c 74 20 66 6f 72 65 |ent defa|ult fore|
|00001190| 67 72 6f 75 6e 64 20 63 | 6f 6c 6f 72 2e 0d 5c 65 |ground c|olor..\e|
|000011a0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|000011b0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|000011c0| 65 74 62 67 63 6f 6c 6f | 72 7d 7b 7d 0d 52 65 74 |etbgcolo|r}{}.Ret|
|000011d0| 75 72 6e 20 74 68 65 20 | 70 69 78 65 6c 20 76 61 |urn the |pixel va|
|000011e0| 6c 75 65 20 6f 66 20 74 | 68 65 20 63 75 72 72 65 |lue of t|he curre|
|000011f0| 6e 74 20 64 65 66 61 75 | 6c 74 20 62 61 63 6b 67 |nt defau|lt backg|
|00001200| 72 6f 75 6e 64 20 63 6f | 6c 6f 72 2e 0d 5c 65 6e |round co|lor..\en|
|00001210| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00001220| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|00001230| 74 66 6f 6e 74 7d 7b 66 | 6f 6e 74 6e 61 6d 65 7d |tfont}{f|ontname}|
|00001240| 0d 53 65 74 20 74 68 65 | 20 63 75 72 72 65 6e 74 |.Set the| current|
|00001250| 20 64 65 66 61 75 6c 74 | 20 66 6f 6e 74 2e 0d 54 | default| font..T|
|00001260| 68 69 73 20 77 69 6c 6c | 20 62 65 63 6f 6d 65 20 |his will| become |
|00001270| 74 68 65 20 64 65 66 61 | 75 6c 74 20 66 6f 6e 74 |the defa|ult font|
|00001280| 20 66 6f 72 20 77 69 6e | 64 6f 77 73 20 6f 70 65 | for win|dows ope|
|00001290| 6e 65 64 20 73 75 62 73 | 65 71 75 65 6e 74 6c 79 |ned subs|equently|
|000012a0| 2c 0d 61 6e 64 20 69 73 | 20 61 6c 73 6f 20 75 73 |,.and is| also us|
|000012b0| 65 64 20 62 79 20 74 68 | 65 20 74 65 78 74 20 6d |ed by th|e text m|
|000012c0| 65 61 73 75 72 69 6e 67 | 20 66 75 6e 63 74 69 6f |easuring| functio|
|000012d0| 6e 73 20 5c 63 6f 64 65 | 7b 74 65 78 74 77 69 64 |ns \code|{textwid|
|000012e0| 74 68 7d 2c 0d 5c 63 6f | 64 65 7b 74 65 78 74 62 |th},.\co|de{textb|
|000012f0| 72 65 61 6b 7d 2c 20 5c | 63 6f 64 65 7b 6c 69 6e |reak}, \|code{lin|
|00001300| 65 68 65 69 67 68 74 7d | 20 61 6e 64 20 5c 63 6f |eheight}| and \co|
|00001310| 64 65 7b 62 61 73 65 6c | 69 6e 65 7d 20 62 65 6c |de{basel|ine} bel|
|00001320| 6f 77 2e 0d 54 68 69 73 | 20 61 63 63 65 70 74 73 |ow..This| accepts|
|00001330| 20 74 77 6f 20 6d 6f 72 | 65 20 6f 70 74 69 6f 6e | two mor|e option|
|00001340| 61 6c 20 70 61 72 61 6d | 65 74 65 72 73 2c 20 73 |al param|eters, s|
|00001350| 69 7a 65 20 61 6e 64 20 | 73 74 79 6c 65 3a 0d 53 |ize and |style:.S|
|00001360| 69 7a 65 20 69 73 20 74 | 68 65 20 66 6f 6e 74 20 |ize is t|he font |
|00001370| 73 69 7a 65 20 28 69 6e | 20 60 70 6f 69 6e 74 73 |size (in| `points|
|00001380| 27 29 2e 0d 53 74 79 6c | 65 20 69 73 20 61 20 73 |')..Styl|e is a s|
|00001390| 69 6e 67 6c 65 20 63 68 | 61 72 61 63 74 65 72 20 |ingle ch|aracter |
|000013a0| 73 70 65 63 69 66 79 69 | 6e 67 20 74 68 65 20 73 |specifyi|ng the s|
|000013b0| 74 79 6c 65 2c 20 61 73 | 20 66 6f 6c 6c 6f 77 73 |tyle, as| follows|
|000013c0| 3a 0d 5c 63 6f 64 65 7b | 27 62 27 7d 20 3d 20 62 |:.\code{|'b'} = b|
|000013d0| 6f 6c 64 2c 0d 5c 63 6f | 64 65 7b 27 69 27 7d 20 |old,.\co|de{'i'} |
|000013e0| 3d 20 69 74 61 6c 69 63 | 2c 0d 5c 63 6f 64 65 7b |= italic|,.\code{|
|000013f0| 27 6f 27 7d 20 3d 20 62 | 6f 6c 64 20 2b 20 69 74 |'o'} = b|old + it|
|00001400| 61 6c 69 63 2c 0d 5c 63 | 6f 64 65 7b 27 75 27 7d |alic,.\c|ode{'u'}|
|00001410| 20 3d 20 75 6e 64 65 72 | 6c 69 6e 65 3b 0d 64 65 | = under|line;.de|
|00001420| 66 61 75 6c 74 20 73 74 | 79 6c 65 20 69 73 20 72 |fault st|yle is r|
|00001430| 6f 6d 61 6e 2e 0d 53 69 | 7a 65 20 61 6e 64 20 73 |oman..Si|ze and s|
|00001440| 74 79 6c 65 20 61 72 65 | 20 69 67 6e 6f 72 65 64 |tyle are| ignored|
|00001450| 20 75 6e 64 65 72 20 58 | 31 31 20 62 75 74 20 75 | under X|11 but u|
|00001460| 73 65 64 20 6f 6e 20 74 | 68 65 20 4d 61 63 69 6e |sed on t|he Macin|
|00001470| 74 6f 73 68 2e 0d 28 53 | 6f 72 72 79 20 66 6f 72 |tosh..(S|orry for|
|00001480| 20 61 6c 6c 20 74 68 69 | 73 20 63 6f 6d 70 6c 65 | all thi|s comple|
|00001490| 78 69 74 79 20 2d 2d 2d | 20 61 20 6d 6f 72 65 20 |xity ---| a more |
|000014a0| 75 6e 69 66 6f 72 6d 20 | 69 6e 74 65 72 66 61 63 |uniform |interfac|
|000014b0| 65 20 69 73 20 62 65 69 | 6e 67 20 64 65 73 69 67 |e is bei|ng desig|
|000014c0| 6e 65 64 2e 29 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |ned.).\e|nd{funcd|
|000014d0| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|000014e0| 63 64 65 73 63 7d 7b 6d | 65 6e 75 63 72 65 61 74 |cdesc}{m|enucreat|
|000014f0| 65 7d 7b 74 69 74 6c 65 | 7d 0d 43 72 65 61 74 65 |e}{title|}.Create|
|00001500| 20 61 20 6d 65 6e 75 20 | 6f 62 6a 65 63 74 20 72 | a menu |object r|
|00001510| 65 66 65 72 72 69 6e 67 | 20 74 6f 20 61 20 67 6c |eferring| to a gl|
|00001520| 6f 62 61 6c 20 6d 65 6e | 75 20 28 61 20 6d 65 6e |obal men|u (a men|
|00001530| 75 20 74 68 61 74 20 61 | 70 70 65 61 72 73 20 69 |u that a|ppears i|
|00001540| 6e 0d 61 6c 6c 20 77 69 | 6e 64 6f 77 73 29 2e 0d |n.all wi|ndows)..|
|00001550| 4d 65 74 68 6f 64 73 20 | 6f 66 20 6d 65 6e 75 20 |Methods |of menu |
|00001560| 6f 62 6a 65 63 74 73 20 | 61 72 65 20 64 65 73 63 |objects |are desc|
|00001570| 72 69 62 65 64 20 62 65 | 6c 6f 77 2e 0d 4e 6f 74 |ribed be|low..Not|
|00001580| 65 3a 20 6e 6f 72 6d 61 | 6c 6c 79 2c 20 6d 65 6e |e: norma|lly, men|
|00001590| 75 73 20 61 72 65 20 63 | 72 65 61 74 65 64 20 6c |us are c|reated l|
|000015a0| 6f 63 61 6c 6c 79 3b 20 | 73 65 65 20 74 68 65 20 |ocally; |see the |
|000015b0| 77 69 6e 64 6f 77 20 6d | 65 74 68 6f 64 0d 5c 63 |window m|ethod.\c|
|000015c0| 6f 64 65 7b 6d 65 6e 75 | 63 72 65 61 74 65 7d 20 |ode{menu|create} |
|000015d0| 62 65 6c 6f 77 2e 0d 5c | 73 74 72 6f 6e 67 7b 57 |below..\|strong{W|
|000015e0| 61 72 6e 69 6e 67 3a 7d | 20 74 68 65 20 6d 65 6e |arning:}| the men|
|000015f0| 75 20 6f 6e 6c 79 20 61 | 70 70 65 61 72 73 20 69 |u only a|ppears i|
|00001600| 6e 20 61 20 77 69 6e 64 | 6f 77 20 61 73 20 6c 6f |n a wind|ow as lo|
|00001610| 6e 67 20 61 73 20 74 68 | 65 20 6f 62 6a 65 63 74 |ng as th|e object|
|00001620| 0d 72 65 74 75 72 6e 65 | 64 20 62 79 20 74 68 69 |.returne|d by thi|
|00001630| 73 20 63 61 6c 6c 20 65 | 78 69 73 74 73 2e 0d 5c |s call e|xists..\|
|00001640| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00001650| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00001660| 6e 65 77 62 69 74 6d 61 | 70 7d 7b 77 69 64 74 68 |newbitma|p}{width|
|00001670| 5c 2c 20 68 65 69 67 68 | 74 7d 0d 43 72 65 61 74 |\, heigh|t}.Creat|
|00001680| 65 20 61 20 6e 65 77 20 | 62 69 74 6d 61 70 20 6f |e a new |bitmap o|
|00001690| 62 6a 65 63 74 20 6f 66 | 20 74 68 65 20 67 69 76 |bject of| the giv|
|000016a0| 65 6e 20 64 69 6d 65 6e | 73 69 6f 6e 73 2e 0d 4d |en dimen|sions..M|
|000016b0| 65 74 68 6f 64 73 20 6f | 66 20 62 69 74 6d 61 70 |ethods o|f bitmap|
|000016c0| 20 6f 62 6a 65 63 74 73 | 20 61 72 65 20 64 65 73 | objects| are des|
|000016d0| 63 72 69 62 65 64 20 62 | 65 6c 6f 77 2e 0d 5c 65 |cribed b|elow..\e|
|000016e0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|000016f0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 66 |egin{fun|cdesc}{f|
|00001700| 6c 65 65 70 7d 7b 7d 0d | 43 61 75 73 65 20 61 20 |leep}{}.|Cause a |
|00001710| 62 65 65 70 20 6f 72 20 | 62 65 6c 6c 20 28 6f 72 |beep or |bell (or|
|00001720| 20 70 65 72 68 61 70 73 | 20 61 20 60 76 69 73 75 | perhaps| a `visu|
|00001730| 61 6c 20 62 65 6c 6c 27 | 20 6f 72 20 66 6c 61 73 |al bell'| or flas|
|00001740| 68 2c 20 68 65 6e 63 65 | 20 74 68 65 0d 6e 61 6d |h, hence| the.nam|
|00001750| 65 29 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |e)..\end|{funcdes|
|00001760| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00001770| 65 73 63 7d 7b 6d 65 73 | 73 61 67 65 7d 7b 73 74 |esc}{mes|sage}{st|
|00001780| 72 69 6e 67 7d 0d 44 69 | 73 70 6c 61 79 20 61 20 |ring}.Di|splay a |
|00001790| 64 69 61 6c 6f 67 20 62 | 6f 78 20 63 6f 6e 74 61 |dialog b|ox conta|
|000017a0| 69 6e 69 6e 67 20 74 68 | 65 20 73 74 72 69 6e 67 |ining th|e string|
|000017b0| 2e 0d 54 68 65 20 75 73 | 65 72 20 6d 75 73 74 20 |..The us|er must |
|000017c0| 63 6c 69 63 6b 20 4f 4b | 20 62 65 66 6f 72 65 20 |click OK| before |
|000017d0| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 20 72 65 74 |the func|tion ret|
|000017e0| 75 72 6e 73 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |urns..\e|nd{funcd|
|000017f0| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00001800| 63 64 65 73 63 7d 7b 61 | 73 6b 79 6e 63 7d 7b 70 |cdesc}{a|skync}{p|
|00001810| 72 6f 6d 70 74 5c 2c 20 | 64 65 66 61 75 6c 74 7d |rompt\, |default}|
|00001820| 0d 44 69 73 70 6c 61 79 | 20 61 20 64 69 61 6c 6f |.Display| a dialo|
|00001830| 67 20 74 68 61 74 20 70 | 72 6f 6d 70 74 73 20 74 |g that p|rompts t|
|00001840| 68 65 20 75 73 65 72 20 | 74 6f 20 61 6e 73 77 65 |he user |to answe|
|00001850| 72 20 61 20 71 75 65 73 | 74 69 6f 6e 20 77 69 74 |r a ques|tion wit|
|00001860| 68 20 79 65 73 20 6f 72 | 0d 6e 6f 2e 0d 52 65 74 |h yes or|.no..Ret|
|00001870| 75 72 6e 20 30 20 66 6f | 72 20 6e 6f 2c 20 31 20 |urn 0 fo|r no, 1 |
|00001880| 66 6f 72 20 79 65 73 2e | 0d 49 66 20 74 68 65 20 |for yes.|.If the |
|00001890| 75 73 65 72 20 68 69 74 | 73 20 74 68 65 20 52 65 |user hit|s the Re|
|000018a0| 74 75 72 6e 20 6b 65 79 | 2c 20 74 68 65 20 64 65 |turn key|, the de|
|000018b0| 66 61 75 6c 74 20 28 77 | 68 69 63 68 20 6d 75 73 |fault (w|hich mus|
|000018c0| 74 20 62 65 20 30 20 6f | 72 20 31 29 20 69 73 0d |t be 0 o|r 1) is.|
|000018d0| 72 65 74 75 72 6e 65 64 | 2e 0d 49 66 20 74 68 65 |returned|..If the|
|000018e0| 20 75 73 65 72 20 63 61 | 6e 63 65 6c 73 20 74 68 | user ca|ncels th|
|000018f0| 65 20 64 69 61 6c 6f 67 | 2c 20 74 68 65 0d 5c 63 |e dialog|, the.\c|
|00001900| 6f 64 65 7b 4b 65 79 62 | 6f 61 72 64 49 6e 74 65 |ode{Keyb|oardInte|
|00001910| 72 72 75 70 74 7d 0d 65 | 78 63 65 70 74 69 6f 6e |rrupt}.e|xception|
|00001920| 20 69 73 20 72 61 69 73 | 65 64 2e 0d 5c 65 6e 64 | is rais|ed..\end|
|00001930| 7b 66 75 6e 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |{funcdes|c}..\beg|
|00001940| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 61 73 6b |in{funcd|esc}{ask|
|00001950| 73 74 72 7d 7b 70 72 6f | 6d 70 74 5c 2c 20 64 65 |str}{pro|mpt\, de|
|00001960| 66 61 75 6c 74 7d 0d 44 | 69 73 70 6c 61 79 20 61 |fault}.D|isplay a|
|00001970| 20 64 69 61 6c 6f 67 20 | 74 68 61 74 20 70 72 6f | dialog |that pro|
|00001980| 6d 70 74 73 20 74 68 65 | 20 75 73 65 72 20 66 6f |mpts the| user fo|
|00001990| 72 20 61 20 73 74 72 69 | 6e 67 2e 0d 49 66 20 74 |r a stri|ng..If t|
|000019a0| 68 65 20 75 73 65 72 20 | 68 69 74 73 20 74 68 65 |he user |hits the|
|000019b0| 20 52 65 74 75 72 6e 20 | 6b 65 79 2c 20 74 68 65 | Return |key, the|
|000019c0| 20 64 65 66 61 75 6c 74 | 20 73 74 72 69 6e 67 20 | default| string |
|000019d0| 69 73 20 72 65 74 75 72 | 6e 65 64 2e 0d 49 66 20 |is retur|ned..If |
|000019e0| 74 68 65 20 75 73 65 72 | 20 63 61 6e 63 65 6c 73 |the user| cancels|
|000019f0| 20 74 68 65 20 64 69 61 | 6c 6f 67 2c 20 74 68 65 | the dia|log, the|
|00001a00| 0d 5c 63 6f 64 65 7b 4b | 65 79 62 6f 61 72 64 49 |.\code{K|eyboardI|
|00001a10| 6e 74 65 72 72 75 70 74 | 7d 0d 65 78 63 65 70 74 |nterrupt|}.except|
|00001a20| 69 6f 6e 20 69 73 20 72 | 61 69 73 65 64 2e 0d 5c |ion is r|aised..\|
|00001a30| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00001a40| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00001a50| 61 73 6b 66 69 6c 65 7d | 7b 70 72 6f 6d 70 74 5c |askfile}|{prompt\|
|00001a60| 2c 20 64 65 66 61 75 6c | 74 5c 2c 20 6e 65 77 7d |, defaul|t\, new}|
|00001a70| 0d 41 73 6b 20 74 68 65 | 20 75 73 65 72 20 74 6f |.Ask the| user to|
|00001a80| 20 73 70 65 63 69 66 79 | 20 61 20 66 69 6c 65 6e | specify| a filen|
|00001a90| 61 6d 65 2e 0d 49 66 0d | 5c 76 61 72 7b 6e 65 77 |ame..If.|\var{new|
|00001aa0| 7d 0d 69 73 20 7a 65 72 | 6f 20 69 74 20 6d 75 73 |}.is zer|o it mus|
|00001ab0| 74 20 62 65 20 61 6e 20 | 65 78 69 73 74 69 6e 67 |t be an |existing|
|00001ac0| 20 66 69 6c 65 3b 20 6f | 74 68 65 72 77 69 73 65 | file; o|therwise|
|00001ad0| 2c 20 69 74 20 6d 75 73 | 74 20 62 65 20 61 20 6e |, it mus|t be a n|
|00001ae0| 65 77 20 66 69 6c 65 2e | 0d 49 66 20 74 68 65 20 |ew file.|.If the |
|00001af0| 75 73 65 72 20 63 61 6e | 63 65 6c 73 20 74 68 65 |user can|cels the|
|00001b00| 20 64 69 61 6c 6f 67 2c | 20 74 68 65 0d 5c 63 6f | dialog,| the.\co|
|00001b10| 64 65 7b 4b 65 79 62 6f | 61 72 64 49 6e 74 65 72 |de{Keybo|ardInter|
|00001b20| 72 75 70 74 7d 0d 65 78 | 63 65 70 74 69 6f 6e 20 |rupt}.ex|ception |
|00001b30| 69 73 20 72 61 69 73 65 | 64 2e 0d 5c 65 6e 64 7b |is raise|d..\end{|
|00001b40| 66 75 6e 63 64 65 73 63 | 7d 0d 0d 5c 62 65 67 69 |funcdesc|}..\begi|
|00001b50| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 73 65 74 63 |n{funcde|sc}{setc|
|00001b60| 75 74 62 75 66 66 65 72 | 7d 7b 69 5c 2c 20 73 74 |utbuffer|}{i\, st|
|00001b70| 72 69 6e 67 7d 0d 53 74 | 6f 72 65 20 74 68 65 20 |ring}.St|ore the |
|00001b80| 73 74 72 69 6e 67 20 69 | 6e 20 74 68 65 20 73 79 |string i|n the sy|
|00001b90| 73 74 65 6d 27 73 20 63 | 75 74 20 62 75 66 66 65 |stem's c|ut buffe|
|00001ba0| 72 20 6e 75 6d 62 65 72 | 0d 5c 76 61 72 7b 69 7d |r number|.\var{i}|
|00001bb0| 2c 0d 77 68 65 72 65 20 | 69 74 20 63 61 6e 20 62 |,.where |it can b|
|00001bc0| 65 20 66 6f 75 6e 64 20 | 28 66 6f 72 20 70 61 73 |e found |(for pas|
|00001bd0| 74 69 6e 67 29 20 62 79 | 20 6f 74 68 65 72 20 61 |ting) by| other a|
|00001be0| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 0d 4f 6e 20 |pplicati|ons..On |
|00001bf0| 58 31 31 2c 20 74 68 65 | 72 65 20 61 72 65 20 38 |X11, the|re are 8|
|00001c00| 20 63 75 74 20 62 75 66 | 66 65 72 73 20 28 6e 75 | cut buf|fers (nu|
|00001c10| 6d 62 65 72 65 64 20 30 | 2e 2e 37 29 2e 0d 43 75 |mbered 0|..7)..Cu|
|00001c20| 74 20 62 75 66 66 65 72 | 20 6e 75 6d 62 65 72 20 |t buffer| number |
|00001c30| 30 20 69 73 20 74 68 65 | 20 60 63 6c 69 70 62 6f |0 is the| `clipbo|
|00001c40| 61 72 64 27 20 6f 6e 20 | 74 68 65 20 4d 61 63 69 |ard' on |the Maci|
|00001c50| 6e 74 6f 73 68 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |ntosh..\|end{func|
|00001c60| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00001c70| 6e 63 64 65 73 63 7d 7b | 67 65 74 63 75 74 62 75 |ncdesc}{|getcutbu|
|00001c80| 66 66 65 72 7d 7b 69 7d | 0d 52 65 74 75 72 6e 20 |ffer}{i}|.Return |
|00001c90| 74 68 65 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |the cont|ents of |
|00001ca0| 74 68 65 20 73 79 73 74 | 65 6d 27 73 20 63 75 74 |the syst|em's cut|
|00001cb0| 20 62 75 66 66 65 72 20 | 6e 75 6d 62 65 72 0d 5c | buffer |number.\|
|00001cc0| 76 61 72 7b 69 7d 2e 0d | 5c 65 6e 64 7b 66 75 6e |var{i}..|\end{fun|
|00001cd0| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00001ce0| 75 6e 63 64 65 73 63 7d | 7b 72 6f 74 61 74 65 63 |uncdesc}|{rotatec|
|00001cf0| 75 74 62 75 66 66 65 72 | 73 7d 7b 6e 7d 0d 4f 6e |utbuffer|s}{n}.On|
|00001d00| 20 58 31 31 2c 20 72 6f | 74 61 74 65 20 74 68 65 | X11, ro|tate the|
|00001d10| 20 38 20 63 75 74 20 62 | 75 66 66 65 72 73 20 62 | 8 cut b|uffers b|
|00001d20| 79 0d 5c 76 61 72 7b 6e | 7d 2e 0d 49 67 6e 6f 72 |y.\var{n|}..Ignor|
|00001d30| 65 64 20 6f 6e 20 74 68 | 65 20 4d 61 63 69 6e 74 |ed on th|e Macint|
|00001d40| 6f 73 68 2e 0d 5c 65 6e | 64 7b 66 75 6e 63 64 65 |osh..\en|d{funcde|
|00001d50| 73 63 7d 0d 0d 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|00001d60| 64 65 73 63 7d 7b 67 65 | 74 73 65 6c 65 63 74 69 |desc}{ge|tselecti|
|00001d70| 6f 6e 7d 7b 69 7d 0d 52 | 65 74 75 72 6e 20 58 31 |on}{i}.R|eturn X1|
|00001d80| 31 20 73 65 6c 65 63 74 | 69 6f 6e 20 6e 75 6d 62 |1 select|ion numb|
|00001d90| 65 72 0d 5c 76 61 72 7b | 69 2e 7d 0d 53 65 6c 65 |er.\var{|i.}.Sele|
|00001da0| 63 74 69 6f 6e 73 20 61 | 72 65 20 6e 6f 74 20 63 |ctions a|re not c|
|00001db0| 75 74 20 62 75 66 66 65 | 72 73 2e 0d 53 65 6c 65 |ut buffe|rs..Sele|
|00001dc0| 63 74 69 6f 6e 20 6e 75 | 6d 62 65 72 73 20 61 72 |ction nu|mbers ar|
|00001dd0| 65 20 64 65 66 69 6e 65 | 64 20 69 6e 20 6d 6f 64 |e define|d in mod|
|00001de0| 75 6c 65 0d 5c 63 6f 64 | 65 7b 73 74 64 77 69 6e |ule.\cod|e{stdwin|
|00001df0| 65 76 65 6e 74 73 7d 2e | 0d 53 65 6c 65 63 74 69 |events}.|.Selecti|
|00001e00| 6f 6e 20 5c 63 6f 64 65 | 7b 57 53 5f 50 52 49 4d |on \code|{WS_PRIM|
|00001e10| 41 52 59 7d 20 69 73 20 | 74 68 65 0d 5c 64 66 6e |ARY} is |the.\dfn|
|00001e20| 7b 70 72 69 6d 61 72 79 | 7d 0d 73 65 6c 65 63 74 |{primary|}.select|
|00001e30| 69 6f 6e 20 28 75 73 65 | 64 20 62 79 0d 78 74 65 |ion (use|d by.xte|
|00001e40| 72 6d 2c 0d 66 6f 72 20 | 69 6e 73 74 61 6e 63 65 |rm,.for |instance|
|00001e50| 29 3b 0d 73 65 6c 65 63 | 74 69 6f 6e 20 5c 63 6f |);.selec|tion \co|
|00001e60| 64 65 7b 57 53 5f 53 45 | 43 4f 4e 44 41 52 59 7d |de{WS_SE|CONDARY}|
|00001e70| 20 69 73 20 74 68 65 0d | 5c 64 66 6e 7b 73 65 63 | is the.|\dfn{sec|
|00001e80| 6f 6e 64 61 72 79 7d 0d | 73 65 6c 65 63 74 69 6f |ondary}.|selectio|
|00001e90| 6e 3b 20 73 65 6c 65 63 | 74 69 6f 6e 20 5c 63 6f |n; selec|tion \co|
|00001ea0| 64 65 7b 57 53 5f 43 4c | 49 50 42 4f 41 52 44 7d |de{WS_CL|IPBOARD}|
|00001eb0| 20 69 73 20 74 68 65 0d | 5c 64 66 6e 7b 63 6c 69 | is the.|\dfn{cli|
|00001ec0| 70 62 6f 61 72 64 7d 0d | 73 65 6c 65 63 74 69 6f |pboard}.|selectio|
|00001ed0| 6e 20 28 75 73 65 64 20 | 62 79 0d 78 63 6c 69 70 |n (used |by.xclip|
|00001ee0| 62 6f 61 72 64 29 2e 0d | 4f 6e 20 74 68 65 20 4d |board)..|On the M|
|00001ef0| 61 63 69 6e 74 6f 73 68 | 2c 20 74 68 69 73 20 61 |acintosh|, this a|
|00001f00| 6c 77 61 79 73 20 72 65 | 74 75 72 6e 73 20 61 6e |lways re|turns an|
|00001f10| 20 65 6d 70 74 79 20 73 | 74 72 69 6e 67 2e 0d 5c | empty s|tring..\|
|00001f20| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00001f30| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00001f40| 72 65 73 65 74 73 65 6c | 65 63 74 69 6f 6e 7d 7b |resetsel|ection}{|
|00001f50| 69 7d 0d 52 65 73 65 74 | 20 73 65 6c 65 63 74 69 |i}.Reset| selecti|
|00001f60| 6f 6e 20 6e 75 6d 62 65 | 72 0d 5c 76 61 72 7b 69 |on numbe|r.\var{i|
|00001f70| 7d 2c 0d 69 66 20 74 68 | 69 73 20 70 72 6f 63 65 |},.if th|is proce|
|00001f80| 73 73 20 6f 77 6e 73 20 | 69 74 2e 0d 28 53 65 65 |ss owns |it..(See|
|00001f90| 20 77 69 6e 64 6f 77 20 | 6d 65 74 68 6f 64 0d 5c | window |method.\|
|00001fa0| 63 6f 64 65 7b 73 65 74 | 73 65 6c 65 63 74 69 6f |code{set|selectio|
|00001fb0| 6e 28 29 7d 29 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |n()})..\|end{func|
|00001fc0| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00001fd0| 6e 63 64 65 73 63 7d 7b | 62 61 73 65 6c 69 6e 65 |ncdesc}{|baseline|
|00001fe0| 7d 7b 7d 0d 52 65 74 75 | 72 6e 20 74 68 65 20 62 |}{}.Retu|rn the b|
|00001ff0| 61 73 65 6c 69 6e 65 20 | 6f 66 20 74 68 65 20 63 |aseline |of the c|
|00002000| 75 72 72 65 6e 74 20 66 | 6f 6e 74 20 28 64 65 66 |urrent f|ont (def|
|00002010| 69 6e 65 64 20 62 79 20 | 53 54 44 57 49 4e 20 61 |ined by |STDWIN a|
|00002020| 73 20 74 68 65 0d 76 65 | 72 74 69 63 61 6c 20 64 |s the.ve|rtical d|
|00002030| 69 73 74 61 6e 63 65 20 | 62 65 74 77 65 65 6e 20 |istance |between |
|00002040| 74 68 65 20 62 61 73 65 | 6c 69 6e 65 20 61 6e 64 |the base|line and|
|00002050| 20 74 68 65 20 74 6f 70 | 20 6f 66 20 74 68 65 0d | the top| of the.|
|00002060| 63 68 61 72 61 63 74 65 | 72 73 29 2e 0d 5c 65 6e |characte|rs)..\en|
|00002070| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00002080| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 6c 69 |gin{func|desc}{li|
|00002090| 6e 65 68 65 69 67 68 74 | 7d 7b 7d 0d 52 65 74 75 |neheight|}{}.Retu|
|000020a0| 72 6e 20 74 68 65 20 74 | 6f 74 61 6c 20 6c 69 6e |rn the t|otal lin|
|000020b0| 65 20 68 65 69 67 68 74 | 20 6f 66 20 74 68 65 20 |e height| of the |
|000020c0| 63 75 72 72 65 6e 74 20 | 66 6f 6e 74 2e 0d 5c 65 |current |font..\e|
|000020d0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|000020e0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 74 |egin{fun|cdesc}{t|
|000020f0| 65 78 74 62 72 65 61 6b | 7d 7b 73 74 72 5c 2c 20 |extbreak|}{str\, |
|00002100| 77 69 64 74 68 7d 0d 52 | 65 74 75 72 6e 20 74 68 |width}.R|eturn th|
|00002110| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 68 61 72 |e number| of char|
|00002120| 61 63 74 65 72 73 20 6f | 66 20 74 68 65 20 73 74 |acters o|f the st|
|00002130| 72 69 6e 67 20 74 68 61 | 74 20 66 69 74 20 69 6e |ring tha|t fit in|
|00002140| 74 6f 20 61 20 73 70 61 | 63 65 20 6f 66 0d 5c 76 |to a spa|ce of.\v|
|00002150| 61 72 7b 77 69 64 74 68 | 7d 0d 62 69 74 73 20 77 |ar{width|}.bits w|
|00002160| 69 64 65 20 77 68 65 6e | 20 64 72 61 77 6e 20 69 |ide when| drawn i|
|00002170| 6e 20 74 68 65 20 63 75 | 72 65 6e 74 20 66 6f 6e |n the cu|rent fon|
|00002180| 74 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |t..\end{|funcdesc|
|00002190| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|000021a0| 73 63 7d 7b 74 65 78 74 | 77 69 64 74 68 7d 7b 73 |sc}{text|width}{s|
|000021b0| 74 72 7d 0d 52 65 74 75 | 72 6e 20 74 68 65 20 77 |tr}.Retu|rn the w|
|000021c0| 69 64 74 68 20 69 6e 20 | 62 69 74 73 20 6f 66 20 |idth in |bits of |
|000021d0| 74 68 65 20 73 74 72 69 | 6e 67 20 77 68 65 6e 20 |the stri|ng when |
|000021e0| 64 72 61 77 6e 20 69 6e | 20 74 68 65 20 63 75 72 |drawn in| the cur|
|000021f0| 72 65 6e 74 20 66 6f 6e | 74 2e 0d 5c 65 6e 64 7b |rent fon|t..\end{|
|00002200| 66 75 6e 63 64 65 73 63 | 7d 0d 0d 5c 62 65 67 69 |funcdesc|}..\begi|
|00002210| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 63 6f 6e 6e |n{funcde|sc}{conn|
|00002220| 65 63 74 69 6f 6e 6e 75 | 6d 62 65 72 7d 7b 7d 0d |ectionnu|mber}{}.|
|00002230| 5c 66 75 6e 63 6c 69 6e | 65 7b 66 69 6c 65 6e 6f |\funclin|e{fileno|
|00002240| 7d 7b 7d 0d 28 58 31 31 | 20 75 6e 64 65 72 20 5c |}{}.(X11| under \|
|00002250| 55 4e 49 58 7b 7d 20 6f | 6e 6c 79 29 20 52 65 74 |UNIX{} o|nly) Ret|
|00002260| 75 72 6e 20 74 68 65 20 | 60 60 63 6f 6e 6e 65 63 |urn the |``connec|
|00002270| 74 69 6f 6e 20 6e 75 6d | 62 65 72 27 27 20 75 73 |tion num|ber'' us|
|00002280| 65 64 20 62 79 20 74 68 | 65 0d 75 6e 64 65 72 6c |ed by th|e.underl|
|00002290| 79 69 6e 67 20 58 31 31 | 20 69 6d 70 6c 65 6d 65 |ying X11| impleme|
|000022a0| 6e 74 61 74 69 6f 6e 2e | 20 20 28 54 68 69 73 20 |ntation.| (This |
|000022b0| 69 73 20 6e 6f 72 6d 61 | 6c 6c 79 20 74 68 65 20 |is norma|lly the |
|000022c0| 66 69 6c 65 20 6e 75 6d | 62 65 72 20 6f 66 0d 74 |file num|ber of.t|
|000022d0| 68 65 20 73 6f 63 6b 65 | 74 2e 29 20 20 42 6f 74 |he socke|t.) Bot|
|000022e0| 68 20 66 75 6e 63 74 69 | 6f 6e 73 20 72 65 74 75 |h functi|ons retu|
|000022f0| 72 6e 20 74 68 65 20 73 | 61 6d 65 20 76 61 6c 75 |rn the s|ame valu|
|00002300| 65 3b 0d 5c 63 6f 64 65 | 7b 63 6f 6e 6e 65 63 74 |e;.\code|{connect|
|00002310| 69 6f 6e 6e 75 6d 62 65 | 72 28 29 7d 20 69 73 20 |ionnumbe|r()} is |
|00002320| 6e 61 6d 65 64 20 61 66 | 74 65 72 20 74 68 65 20 |named af|ter the |
|00002330| 63 6f 72 72 65 73 70 6f | 6e 64 69 6e 67 20 66 75 |correspo|nding fu|
|00002340| 6e 63 74 69 6f 6e 20 69 | 6e 0d 58 31 31 20 61 6e |nction i|n.X11 an|
|00002350| 64 20 53 54 44 57 49 4e | 2c 20 77 68 69 6c 65 20 |d STDWIN|, while |
|00002360| 5c 63 6f 64 65 7b 66 69 | 6c 65 6e 6f 28 29 7d 20 |\code{fi|leno()} |
|00002370| 6d 61 6b 65 73 20 69 74 | 20 70 6f 73 73 69 62 6c |makes it| possibl|
|00002380| 65 20 74 6f 20 75 73 65 | 20 74 68 65 0d 5c 63 6f |e to use| the.\co|
|00002390| 64 65 7b 73 74 64 77 69 | 6e 7d 20 6d 6f 64 75 6c |de{stdwi|n} modul|
|000023a0| 65 20 61 73 20 61 20 60 | 60 66 69 6c 65 27 27 20 |e as a `|`file'' |
|000023b0| 6f 62 6a 65 63 74 20 70 | 61 72 61 6d 65 74 65 72 |object p|arameter|
|000023c0| 20 74 6f 0d 5c 63 6f 64 | 65 7b 73 65 6c 65 63 74 | to.\cod|e{select|
|000023d0| 2e 73 65 6c 65 63 74 28 | 29 7d 2e 20 20 4e 6f 74 |.select(|)}. Not|
|000023e0| 65 20 74 68 61 74 20 69 | 66 20 5c 63 6f 64 65 7b |e that i|f \code{|
|000023f0| 73 65 6c 65 63 74 28 29 | 7d 20 69 6d 70 6c 69 65 |select()|} implie|
|00002400| 73 20 74 68 61 74 0d 69 | 6e 70 75 74 20 69 73 20 |s that.i|nput is |
|00002410| 70 6f 73 73 69 62 6c 65 | 20 6f 6e 20 5c 63 6f 64 |possible| on \cod|
|00002420| 65 7b 73 74 64 77 69 6e | 7d 2c 20 74 68 69 73 20 |e{stdwin|}, this |
|00002430| 64 6f 65 73 20 6e 6f 74 | 20 67 75 61 72 61 6e 74 |does not| guarant|
|00002440| 65 65 20 74 68 61 74 20 | 61 6e 0d 65 76 65 6e 74 |ee that |an.event|
|00002450| 20 69 73 20 72 65 61 64 | 79 20 2d 2d 2d 20 69 74 | is read|y --- it|
|00002460| 20 6d 61 79 20 62 65 20 | 73 6f 6d 65 20 69 6e 74 | may be |some int|
|00002470| 65 72 6e 61 6c 20 63 6f | 6d 6d 75 6e 69 63 61 74 |ernal co|mmunicat|
|00002480| 69 6f 6e 20 67 6f 69 6e | 67 20 6f 6e 0d 62 65 74 |ion goin|g on.bet|
|00002490| 77 65 65 6e 20 74 68 65 | 20 58 20 73 65 72 76 65 |ween the| X serve|
|000024a0| 72 20 61 6e 64 20 74 68 | 65 20 63 6c 69 65 6e 74 |r and th|e client|
|000024b0| 20 6c 69 62 72 61 72 79 | 2e 20 20 54 68 75 73 2c | library|. Thus,|
|000024c0| 20 79 6f 75 20 73 68 6f | 75 6c 64 20 63 61 6c 6c | you sho|uld call|
|000024d0| 0d 5c 63 6f 64 65 7b 73 | 74 64 77 69 6e 2e 70 6f |.\code{s|tdwin.po|
|000024e0| 6c 6c 65 76 65 6e 74 28 | 29 7d 20 75 6e 74 69 6c |llevent(|)} until|
|000024f0| 20 69 74 20 72 65 74 75 | 72 6e 73 20 5c 63 6f 64 | it retu|rns \cod|
|00002500| 65 7b 4e 6f 6e 65 7d 20 | 74 6f 20 63 68 65 63 6b |e{None} |to check|
|00002510| 20 66 6f 72 0d 65 76 65 | 6e 74 73 20 69 66 20 79 | for.eve|nts if y|
|00002520| 6f 75 20 64 6f 6e 27 74 | 20 77 61 6e 74 20 79 6f |ou don't| want yo|
|00002530| 75 72 20 70 72 6f 67 72 | 61 6d 20 74 6f 20 62 6c |ur progr|am to bl|
|00002540| 6f 63 6b 2e 20 20 42 65 | 63 61 75 73 65 20 6f 66 |ock. Be|cause of|
|00002550| 20 69 6e 74 65 72 6e 61 | 6c 0d 62 75 66 66 65 72 | interna|l.buffer|
|00002560| 69 6e 67 20 69 6e 20 58 | 31 31 2c 20 69 74 20 69 |ing in X|11, it i|
|00002570| 73 20 61 6c 73 6f 20 70 | 6f 73 73 69 62 6c 65 20 |s also p|ossible |
|00002580| 74 68 61 74 20 5c 63 6f | 64 65 7b 73 74 64 77 69 |that \co|de{stdwi|
|00002590| 6e 2e 70 6f 6c 6c 65 76 | 65 6e 74 28 29 7d 0d 72 |n.pollev|ent()}.r|
|000025a0| 65 74 75 72 6e 73 20 61 | 6e 20 65 76 65 6e 74 20 |eturns a|n event |
|000025b0| 77 68 69 6c 65 20 5c 63 | 6f 64 65 7b 73 65 6c 65 |while \c|ode{sele|
|000025c0| 63 74 28 29 7d 20 64 6f | 65 73 20 6e 6f 74 20 66 |ct()} do|es not f|
|000025d0| 69 6e 64 20 5c 63 6f 64 | 65 7b 73 74 64 77 69 6e |ind \cod|e{stdwin|
|000025e0| 7d 20 74 6f 0d 62 65 20 | 72 65 61 64 79 2c 20 73 |} to.be |ready, s|
|000025f0| 6f 20 79 6f 75 20 73 68 | 6f 75 6c 64 20 72 65 61 |o you sh|ould rea|
|00002600| 64 20 61 6e 79 20 70 65 | 6e 64 69 6e 67 20 65 76 |d any pe|nding ev|
|00002610| 65 6e 74 73 20 77 69 74 | 68 0d 5c 63 6f 64 65 7b |ents wit|h.\code{|
|00002620| 73 74 64 77 69 6e 2e 70 | 6f 6c 6c 65 76 65 6e 74 |stdwin.p|ollevent|
|00002630| 28 29 7d 20 75 6e 74 69 | 6c 20 69 74 20 72 65 74 |()} unti|l it ret|
|00002640| 75 72 6e 73 20 5c 63 6f | 64 65 7b 4e 6f 6e 65 7d |urns \co|de{None}|
|00002650| 20 62 65 66 6f 72 65 20 | 65 6e 74 65 72 69 6e 67 | before |entering|
|00002660| 0d 61 20 62 6c 6f 63 6b | 69 6e 67 20 5c 63 6f 64 |.a block|ing \cod|
|00002670| 65 7b 73 65 6c 65 63 74 | 28 29 7d 20 63 61 6c 6c |e{select|()} call|
|00002680| 2e 0d 5c 74 74 69 6e 64 | 65 78 7b 73 65 6c 65 63 |..\ttind|ex{selec|
|00002690| 74 7d 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |t}.\end{|funcdesc|
|000026a0| 7d 0d 0d 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 57 |}..\subs|ection{W|
|000026b0| 69 6e 64 6f 77 20 4f 62 | 6a 65 63 74 20 4d 65 74 |indow Ob|ject Met|
|000026c0| 68 6f 64 73 7d 0d 0d 57 | 69 6e 64 6f 77 20 6f 62 |hods}..W|indow ob|
|000026d0| 6a 65 63 74 73 20 61 72 | 65 20 63 72 65 61 74 65 |jects ar|e create|
|000026e0| 64 20 62 79 20 5c 63 6f | 64 65 7b 73 74 64 77 69 |d by \co|de{stdwi|
|000026f0| 6e 2e 6f 70 65 6e 28 29 | 7d 2e 20 20 54 68 65 79 |n.open()|}. They|
|00002700| 20 61 72 65 20 63 6c 6f | 73 65 64 0d 62 79 20 74 | are clo|sed.by t|
|00002710| 68 65 69 72 20 5c 63 6f | 64 65 7b 63 6c 6f 73 65 |heir \co|de{close|
|00002720| 28 29 7d 20 6d 65 74 68 | 6f 64 20 6f 72 20 77 68 |()} meth|od or wh|
|00002730| 65 6e 20 74 68 65 79 20 | 61 72 65 20 67 61 72 62 |en they |are garb|
|00002740| 61 67 65 2d 63 6f 6c 6c | 65 63 74 65 64 2e 0d 57 |age-coll|ected..W|
|00002750| 69 6e 64 6f 77 20 6f 62 | 6a 65 63 74 73 20 68 61 |indow ob|jects ha|
|00002760| 76 65 20 74 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |ve the f|ollowing|
|00002770| 20 6d 65 74 68 6f 64 73 | 3a 0d 0d 5c 72 65 6e 65 | methods|:..\rene|
|00002780| 77 63 6f 6d 6d 61 6e 64 | 7b 5c 69 6e 64 65 78 73 |wcommand|{\indexs|
|00002790| 75 62 69 74 65 6d 7d 7b | 28 77 69 6e 64 6f 77 20 |ubitem}{|(window |
|000027a0| 6d 65 74 68 6f 64 29 7d | 0d 0d 5c 62 65 67 69 6e |method)}|..\begin|
|000027b0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 62 65 67 69 6e |{funcdes|c}{begin|
|000027c0| 64 72 61 77 69 6e 67 7d | 7b 7d 0d 52 65 74 75 72 |drawing}|{}.Retur|
|000027d0| 6e 20 61 20 64 72 61 77 | 69 6e 67 20 6f 62 6a 65 |n a draw|ing obje|
|000027e0| 63 74 2c 20 77 68 6f 73 | 65 20 6d 65 74 68 6f 64 |ct, whos|e method|
|000027f0| 73 20 28 64 65 73 63 72 | 69 62 65 64 20 62 65 6c |s (descr|ibed bel|
|00002800| 6f 77 29 20 61 6c 6c 6f | 77 20 64 72 61 77 69 6e |ow) allo|w drawin|
|00002810| 67 0d 69 6e 20 74 68 65 | 20 77 69 6e 64 6f 77 2e |g.in the| window.|
|00002820| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00002830| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00002840| 7d 7b 63 68 61 6e 67 65 | 7d 7b 72 65 63 74 7d 0d |}{change|}{rect}.|
|00002850| 49 6e 76 61 6c 69 64 61 | 74 65 20 74 68 65 20 67 |Invalida|te the g|
|00002860| 69 76 65 6e 20 72 65 63 | 74 61 6e 67 6c 65 3b 20 |iven rec|tangle; |
|00002870| 74 68 69 73 20 6d 61 79 | 20 63 61 75 73 65 20 61 |this may| cause a|
|00002880| 20 64 72 61 77 20 65 76 | 65 6e 74 2e 0d 5c 65 6e | draw ev|ent..\en|
|00002890| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|000028a0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 67 65 |gin{func|desc}{ge|
|000028b0| 74 74 69 74 6c 65 7d 7b | 7d 0d 52 65 74 75 72 6e |ttitle}{|}.Return|
|000028c0| 73 20 74 68 65 20 77 69 | 6e 64 6f 77 27 73 20 74 |s the wi|ndow's t|
|000028d0| 69 74 6c 65 20 73 74 72 | 69 6e 67 2e 0d 5c 65 6e |itle str|ing..\en|
|000028e0| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|000028f0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 67 65 |gin{func|desc}{ge|
|00002900| 74 64 6f 63 73 69 7a 65 | 7d 7b 7d 0d 5c 62 65 67 |tdocsize|}{}.\beg|
|00002910| 69 6e 7b 73 6c 6f 70 70 | 79 70 61 72 7d 0d 52 65 |in{slopp|ypar}.Re|
|00002920| 74 75 72 6e 20 61 20 70 | 61 69 72 20 6f 66 20 69 |turn a p|air of i|
|00002930| 6e 74 65 67 65 72 73 20 | 67 69 76 69 6e 67 20 74 |ntegers |giving t|
|00002940| 68 65 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 64 |he size |of the d|
|00002950| 6f 63 75 6d 65 6e 74 20 | 61 73 20 73 65 74 20 62 |ocument |as set b|
|00002960| 79 0d 5c 63 6f 64 65 7b | 73 65 74 64 6f 63 73 69 |y.\code{|setdocsi|
|00002970| 7a 65 28 29 7d 2e 0d 5c | 65 6e 64 7b 73 6c 6f 70 |ze()}..\|end{slop|
|00002980| 70 79 70 61 72 7d 0d 5c | 65 6e 64 7b 66 75 6e 63 |pypar}.\|end{func|
|00002990| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|000029a0| 6e 63 64 65 73 63 7d 7b | 67 65 74 6f 72 69 67 69 |ncdesc}{|getorigi|
|000029b0| 6e 7d 7b 7d 0d 52 65 74 | 75 72 6e 20 61 20 70 61 |n}{}.Ret|urn a pa|
|000029c0| 69 72 20 6f 66 20 69 6e | 74 65 67 65 72 73 20 67 |ir of in|tegers g|
|000029d0| 69 76 69 6e 67 20 74 68 | 65 20 6f 72 69 67 69 6e |iving th|e origin|
|000029e0| 20 6f 66 20 74 68 65 20 | 77 69 6e 64 6f 77 20 77 | of the |window w|
|000029f0| 69 74 68 20 72 65 73 70 | 65 63 74 0d 74 6f 20 74 |ith resp|ect.to t|
|00002a00| 68 65 20 64 6f 63 75 6d | 65 6e 74 2e 0d 5c 65 6e |he docum|ent..\en|
|00002a10| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00002a20| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 67 65 |gin{func|desc}{ge|
|00002a30| 74 74 69 74 6c 65 7d 7b | 7d 0d 52 65 74 75 72 6e |ttitle}{|}.Return|
|00002a40| 20 74 68 65 20 77 69 6e | 64 6f 77 27 73 20 74 69 | the win|dow's ti|
|00002a50| 74 6c 65 20 73 74 72 69 | 6e 67 2e 0d 5c 65 6e 64 |tle stri|ng..\end|
|00002a60| 7b 66 75 6e 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |{funcdes|c}..\beg|
|00002a70| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 67 65 74 |in{funcd|esc}{get|
|00002a80| 77 69 6e 73 69 7a 65 7d | 7b 7d 0d 52 65 74 75 72 |winsize}|{}.Retur|
|00002a90| 6e 20 61 20 70 61 69 72 | 20 6f 66 20 69 6e 74 65 |n a pair| of inte|
|00002aa0| 67 65 72 73 20 67 69 76 | 69 6e 67 20 74 68 65 20 |gers giv|ing the |
|00002ab0| 73 69 7a 65 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |size of |the wind|
|00002ac0| 6f 77 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ow..\end|{funcdes|
|00002ad0| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00002ae0| 65 73 63 7d 7b 67 65 74 | 77 69 6e 70 6f 73 7d 7b |esc}{get|winpos}{|
|00002af0| 7d 0d 52 65 74 75 72 6e | 20 61 20 70 61 69 72 20 |}.Return| a pair |
|00002b00| 6f 66 20 69 6e 74 65 67 | 65 72 73 20 67 69 76 69 |of integ|ers givi|
|00002b10| 6e 67 20 74 68 65 20 70 | 6f 73 69 74 69 6f 6e 20 |ng the p|osition |
|00002b20| 6f 66 20 74 68 65 20 77 | 69 6e 64 6f 77 27 73 20 |of the w|indow's |
|00002b30| 75 70 70 65 72 0d 6c 65 | 66 74 20 63 6f 72 6e 65 |upper.le|ft corne|
|00002b40| 72 20 28 72 65 6c 61 74 | 69 76 65 20 74 6f 20 74 |r (relat|ive to t|
|00002b50| 68 65 20 75 70 70 65 72 | 20 6c 65 66 74 20 63 6f |he upper| left co|
|00002b60| 72 6e 65 72 20 6f 66 20 | 74 68 65 20 73 63 72 65 |rner of |the scre|
|00002b70| 65 6e 29 2e 0d 5c 65 6e | 64 7b 66 75 6e 63 64 65 |en)..\en|d{funcde|
|00002b80| 73 63 7d 0d 0d 5c 62 65 | 67 69 6e 7b 66 75 6e 63 |sc}..\be|gin{func|
|00002b90| 64 65 73 63 7d 7b 6d 65 | 6e 75 63 72 65 61 74 65 |desc}{me|nucreate|
|00002ba0| 7d 7b 74 69 74 6c 65 7d | 0d 43 72 65 61 74 65 20 |}{title}|.Create |
|00002bb0| 61 20 6d 65 6e 75 20 6f | 62 6a 65 63 74 20 72 65 |a menu o|bject re|
|00002bc0| 66 65 72 72 69 6e 67 20 | 74 6f 20 61 20 6c 6f 63 |ferring |to a loc|
|00002bd0| 61 6c 20 6d 65 6e 75 20 | 28 61 20 6d 65 6e 75 20 |al menu |(a menu |
|00002be0| 74 68 61 74 20 61 70 70 | 65 61 72 73 0d 6f 6e 6c |that app|ears.onl|
|00002bf0| 79 20 69 6e 20 74 68 69 | 73 20 77 69 6e 64 6f 77 |y in thi|s window|
|00002c00| 29 2e 0d 4d 65 74 68 6f | 64 73 20 6f 66 20 6d 65 |)..Metho|ds of me|
|00002c10| 6e 75 20 6f 62 6a 65 63 | 74 73 20 61 72 65 20 64 |nu objec|ts are d|
|00002c20| 65 73 63 72 69 62 65 64 | 20 62 65 6c 6f 77 2e 0d |escribed| below..|
|00002c30| 7b 5c 62 66 20 57 61 72 | 6e 69 6e 67 3a 7d 20 74 |{\bf War|ning:} t|
|00002c40| 68 65 20 6d 65 6e 75 20 | 6f 6e 6c 79 20 61 70 70 |he menu |only app|
|00002c50| 65 61 72 73 20 61 73 20 | 6c 6f 6e 67 20 61 73 20 |ears as |long as |
|00002c60| 74 68 65 20 6f 62 6a 65 | 63 74 0d 72 65 74 75 72 |the obje|ct.retur|
|00002c70| 6e 65 64 20 62 79 20 74 | 68 69 73 20 63 61 6c 6c |ned by t|his call|
|00002c80| 20 65 78 69 73 74 73 2e | 0d 5c 65 6e 64 7b 66 75 | exists.|.\end{fu|
|00002c90| 6e 63 64 65 73 63 7d 0d | 0d 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00002ca0| 66 75 6e 63 64 65 73 63 | 7d 7b 73 63 72 6f 6c 6c |funcdesc|}{scroll|
|00002cb0| 7d 7b 72 65 63 74 5c 2c | 20 70 6f 69 6e 74 7d 0d |}{rect\,| point}.|
|00002cc0| 53 63 72 6f 6c 6c 20 74 | 68 65 20 67 69 76 65 6e |Scroll t|he given|
|00002cd0| 20 72 65 63 74 61 6e 67 | 6c 65 20 62 79 20 74 68 | rectang|le by th|
|00002ce0| 65 20 76 65 63 74 6f 72 | 20 67 69 76 65 6e 20 62 |e vector| given b|
|00002cf0| 79 20 74 68 65 20 70 6f | 69 6e 74 2e 0d 5c 65 6e |y the po|int..\en|
|00002d00| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00002d10| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|00002d20| 74 64 6f 63 73 69 7a 65 | 7d 7b 70 6f 69 6e 74 7d |tdocsize|}{point}|
|00002d30| 0d 53 65 74 20 74 68 65 | 20 73 69 7a 65 20 6f 66 |.Set the| size of|
|00002d40| 20 74 68 65 20 64 72 61 | 77 69 6e 67 20 64 6f 63 | the dra|wing doc|
|00002d50| 75 6d 65 6e 74 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |ument..\|end{func|
|00002d60| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00002d70| 6e 63 64 65 73 63 7d 7b | 73 65 74 6f 72 69 67 69 |ncdesc}{|setorigi|
|00002d80| 6e 7d 7b 70 6f 69 6e 74 | 7d 0d 4d 6f 76 65 20 74 |n}{point|}.Move t|
|00002d90| 68 65 20 6f 72 69 67 69 | 6e 20 6f 66 20 74 68 65 |he origi|n of the|
|00002da0| 20 77 69 6e 64 6f 77 20 | 28 69 74 73 20 75 70 70 | window |(its upp|
|00002db0| 65 72 20 6c 65 66 74 20 | 63 6f 72 6e 65 72 29 0d |er left |corner).|
|00002dc0| 74 6f 20 74 68 65 20 67 | 69 76 65 6e 20 70 6f 69 |to the g|iven poi|
|00002dd0| 6e 74 20 69 6e 20 74 68 | 65 20 64 6f 63 75 6d 65 |nt in th|e docume|
|00002de0| 6e 74 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |nt..\end|{funcdes|
|00002df0| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00002e00| 65 73 63 7d 7b 73 65 74 | 73 65 6c 65 63 74 69 6f |esc}{set|selectio|
|00002e10| 6e 7d 7b 69 5c 2c 20 73 | 74 72 7d 0d 41 74 74 65 |n}{i\, s|tr}.Atte|
|00002e20| 6d 70 74 20 74 6f 20 73 | 65 74 20 58 31 31 20 73 |mpt to s|et X11 s|
|00002e30| 65 6c 65 63 74 69 6f 6e | 20 6e 75 6d 62 65 72 0d |election| number.|
|00002e40| 5c 76 61 72 7b 69 7d 0d | 74 6f 20 74 68 65 20 73 |\var{i}.|to the s|
|00002e50| 74 72 69 6e 67 0d 5c 76 | 61 72 7b 73 74 72 7d 2e |tring.\v|ar{str}.|
|00002e60| 0d 28 53 65 65 20 73 74 | 64 77 69 6e 20 6d 65 74 |.(See st|dwin met|
|00002e70| 68 6f 64 0d 5c 63 6f 64 | 65 7b 67 65 74 73 65 6c |hod.\cod|e{getsel|
|00002e80| 65 63 74 69 6f 6e 28 29 | 7d 0d 66 6f 72 20 74 68 |ection()|}.for th|
|00002e90| 65 20 6d 65 61 6e 69 6e | 67 20 6f 66 0d 5c 76 61 |e meanin|g of.\va|
|00002ea0| 72 7b 69 7d 2e 29 0d 52 | 65 74 75 72 6e 20 74 72 |r{i}.).R|eturn tr|
|00002eb0| 75 65 20 69 66 20 69 74 | 20 73 75 63 63 65 65 64 |ue if it| succeed|
|00002ec0| 73 2e 0d 49 66 20 20 73 | 75 63 63 65 65 64 73 2c |s..If s|ucceeds,|
|00002ed0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 60 60 6f 77 | the win|dow ``ow|
|00002ee0| 6e 73 27 27 20 74 68 65 | 20 73 65 6c 65 63 74 69 |ns'' the| selecti|
|00002ef0| 6f 6e 20 75 6e 74 69 6c | 0d 28 61 29 20 61 6e 6f |on until|.(a) ano|
|00002f00| 74 68 65 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ther app|lication|
|00002f10| 20 74 61 6b 65 73 20 6f | 77 6e 65 72 73 68 69 70 | takes o|wnership|
|00002f20| 20 6f 66 20 74 68 65 20 | 73 65 6c 65 63 74 69 6f | of the |selectio|
|00002f30| 6e 3b 20 6f 72 0d 28 62 | 29 20 74 68 65 20 77 69 |n; or.(b|) the wi|
|00002f40| 6e 64 6f 77 20 69 73 20 | 64 65 6c 65 74 65 64 3b |ndow is |deleted;|
|00002f50| 20 6f 72 0d 28 63 29 20 | 74 68 65 20 61 70 70 6c | or.(c) |the appl|
|00002f60| 69 63 61 74 69 6f 6e 20 | 63 6c 65 61 72 73 20 6f |ication |clears o|
|00002f70| 77 6e 65 72 73 68 69 70 | 20 62 79 20 63 61 6c 6c |wnership| by call|
|00002f80| 69 6e 67 0d 5c 63 6f 64 | 65 7b 73 74 64 77 69 6e |ing.\cod|e{stdwin|
|00002f90| 2e 72 65 73 65 74 73 65 | 6c 65 63 74 69 6f 6e 28 |.resetse|lection(|
|00002fa0| 5c 76 61 72 7b 69 7d 29 | 7d 2e 0d 57 68 65 6e 20 |\var{i})|}..When |
|00002fb0| 61 6e 6f 74 68 65 72 20 | 61 70 70 6c 69 63 61 74 |another |applicat|
|00002fc0| 69 6f 6e 20 74 61 6b 65 | 73 20 6f 77 6e 65 72 73 |ion take|s owners|
|00002fd0| 68 69 70 20 6f 66 20 74 | 68 65 20 73 65 6c 65 63 |hip of t|he selec|
|00002fe0| 74 69 6f 6e 2c 20 61 0d | 5c 63 6f 64 65 7b 57 45 |tion, a.|\code{WE|
|00002ff0| 5f 4c 4f 53 54 5f 53 45 | 4c 7d 0d 65 76 65 6e 74 |_LOST_SE|L}.event|
|00003000| 20 69 73 20 72 65 63 65 | 69 76 65 64 20 66 6f 72 | is rece|ived for|
|00003010| 20 6e 6f 20 70 61 72 74 | 69 63 75 6c 61 72 20 77 | no part|icular w|
|00003020| 69 6e 64 6f 77 20 61 6e | 64 20 77 69 74 68 20 74 |indow an|d with t|
|00003030| 68 65 20 73 65 6c 65 63 | 74 69 6f 6e 20 6e 75 6d |he selec|tion num|
|00003040| 62 65 72 0d 61 73 20 64 | 65 74 61 69 6c 2e 0d 49 |ber.as d|etail..I|
|00003050| 67 6e 6f 72 65 64 20 6f | 6e 20 74 68 65 20 4d 61 |gnored o|n the Ma|
|00003060| 63 69 6e 74 6f 73 68 2e | 0d 5c 65 6e 64 7b 66 75 |cintosh.|.\end{fu|
|00003070| 6e 63 64 65 73 63 7d 0d | 0d 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00003080| 66 75 6e 63 64 65 73 63 | 7d 7b 73 65 74 74 69 6d |funcdesc|}{settim|
|00003090| 65 72 7d 7b 64 73 65 63 | 73 7d 0d 53 63 68 65 64 |er}{dsec|s}.Sched|
|000030a0| 75 6c 65 20 61 20 74 69 | 6d 65 72 20 65 76 65 6e |ule a ti|mer even|
|000030b0| 74 20 66 6f 72 20 74 68 | 65 20 77 69 6e 64 6f 77 |t for th|e window|
|000030c0| 20 69 6e 0d 5c 63 6f 64 | 65 7b 5c 76 61 72 7b 64 | in.\cod|e{\var{d|
|000030d0| 73 65 63 73 7d 2f 31 30 | 7d 0d 73 65 63 6f 6e 64 |secs}/10|}.second|
|000030e0| 73 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |s..\end{|funcdesc|
|000030f0| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00003100| 73 63 7d 7b 73 65 74 74 | 69 74 6c 65 7d 7b 74 69 |sc}{sett|itle}{ti|
|00003110| 74 6c 65 7d 0d 53 65 74 | 20 74 68 65 20 77 69 6e |tle}.Set| the win|
|00003120| 64 6f 77 27 73 20 74 69 | 74 6c 65 20 73 74 72 69 |dow's ti|tle stri|
|00003130| 6e 67 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ng..\end|{funcdes|
|00003140| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00003150| 65 73 63 7d 7b 73 65 74 | 77 69 6e 63 75 72 73 6f |esc}{set|wincurso|
|00003160| 72 7d 7b 6e 61 6d 65 7d | 0d 5c 62 65 67 69 6e 7b |r}{name}|.\begin{|
|00003170| 73 6c 6f 70 70 79 70 61 | 72 7d 0d 53 65 74 20 74 |sloppypa|r}.Set t|
|00003180| 68 65 20 77 69 6e 64 6f | 77 20 63 75 72 73 6f 72 |he windo|w cursor|
|00003190| 20 74 6f 20 61 20 63 75 | 72 73 6f 72 20 6f 66 20 | to a cu|rsor of |
|000031a0| 74 68 65 20 67 69 76 65 | 6e 20 6e 61 6d 65 2e 0d |the give|n name..|
|000031b0| 49 74 20 72 61 69 73 65 | 73 20 74 68 65 0d 5c 63 |It raise|s the.\c|
|000031c0| 6f 64 65 7b 52 75 6e 74 | 69 6d 65 45 72 72 6f 72 |ode{Runt|imeError|
|000031d0| 7d 0d 65 78 63 65 70 74 | 69 6f 6e 20 69 66 20 6e |}.except|ion if n|
|000031e0| 6f 20 63 75 72 73 6f 72 | 20 6f 66 20 74 68 65 20 |o cursor| of the |
|000031f0| 67 69 76 65 6e 20 6e 61 | 6d 65 20 65 78 69 73 74 |given na|me exist|
|00003200| 73 2e 0d 53 75 69 74 61 | 62 6c 65 20 6e 61 6d 65 |s..Suita|ble name|
|00003210| 73 20 69 6e 63 6c 75 64 | 65 0d 5c 63 6f 64 65 7b |s includ|e.\code{|
|00003220| 27 69 62 65 61 6d 27 7d | 2c 0d 5c 63 6f 64 65 7b |'ibeam'}|,.\code{|
|00003230| 27 61 72 72 6f 77 27 7d | 2c 0d 5c 63 6f 64 65 7b |'arrow'}|,.\code{|
|00003240| 27 63 72 6f 73 73 27 7d | 2c 0d 5c 63 6f 64 65 7b |'cross'}|,.\code{|
|00003250| 27 77 61 74 63 68 27 7d | 0d 61 6e 64 0d 5c 63 6f |'watch'}|.and.\co|
|00003260| 64 65 7b 27 70 6c 75 73 | 27 7d 2e 0d 4f 6e 20 58 |de{'plus|'}..On X|
|00003270| 31 31 2c 20 74 68 65 72 | 65 20 61 72 65 20 6d 61 |11, ther|e are ma|
|00003280| 6e 79 20 6d 6f 72 65 20 | 28 73 65 65 0d 5c 66 69 |ny more |(see.\fi|
|00003290| 6c 65 7b 3c 58 31 31 2f | 63 75 72 73 6f 72 66 6f |le{<X11/|cursorfo|
|000032a0| 6e 74 2e 68 3e 7d 29 2e | 0d 5c 65 6e 64 7b 73 6c |nt.h>}).|.\end{sl|
|000032b0| 6f 70 70 79 70 61 72 7d | 0d 5c 65 6e 64 7b 66 75 |oppypar}|.\end{fu|
|000032c0| 6e 63 64 65 73 63 7d 0d | 0d 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|000032d0| 66 75 6e 63 64 65 73 63 | 7d 7b 73 65 74 77 69 6e |funcdesc|}{setwin|
|000032e0| 70 6f 73 7d 7b 68 5c 2c | 20 76 7d 0d 53 65 74 20 |pos}{h\,| v}.Set |
|000032f0| 74 68 65 20 74 68 65 20 | 70 6f 73 69 74 69 6f 6e |the the |position|
|00003300| 20 6f 66 20 74 68 65 20 | 77 69 6e 64 6f 77 27 73 | of the |window's|
|00003310| 20 75 70 70 65 72 20 6c | 65 66 74 20 63 6f 72 6e | upper l|eft corn|
|00003320| 65 72 20 28 72 65 6c 61 | 74 69 76 65 20 74 6f 0d |er (rela|tive to.|
|00003330| 74 68 65 20 75 70 70 65 | 72 20 6c 65 66 74 20 63 |the uppe|r left c|
|00003340| 6f 72 6e 65 72 20 6f 66 | 20 74 68 65 20 73 63 72 |orner of| the scr|
|00003350| 65 65 6e 29 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |een)..\e|nd{funcd|
|00003360| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00003370| 63 64 65 73 63 7d 7b 73 | 65 74 77 69 6e 73 69 7a |cdesc}{s|etwinsiz|
|00003380| 65 7d 7b 77 69 64 74 68 | 5c 2c 20 68 65 69 67 68 |e}{width|\, heigh|
|00003390| 74 7d 0d 53 65 74 20 74 | 68 65 20 77 69 6e 64 6f |t}.Set t|he windo|
|000033a0| 77 27 73 20 73 69 7a 65 | 2e 0d 5c 65 6e 64 7b 66 |w's size|..\end{f|
|000033b0| 75 6e 63 64 65 73 63 7d | 0d 0d 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000033c0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 73 68 6f 77 7d |{funcdes|c}{show}|
|000033d0| 7b 72 65 63 74 7d 0d 54 | 72 79 20 74 6f 20 65 6e |{rect}.T|ry to en|
|000033e0| 73 75 72 65 20 74 68 61 | 74 20 74 68 65 20 67 69 |sure tha|t the gi|
|000033f0| 76 65 6e 20 72 65 63 74 | 61 6e 67 6c 65 20 6f 66 |ven rect|angle of|
|00003400| 20 74 68 65 20 64 6f 63 | 75 6d 65 6e 74 20 69 73 | the doc|ument is|
|00003410| 20 76 69 73 69 62 6c 65 | 20 69 6e 0d 74 68 65 20 | visible| in.the |
|00003420| 77 69 6e 64 6f 77 2e 0d | 5c 65 6e 64 7b 66 75 6e |window..|\end{fun|
|00003430| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00003440| 75 6e 63 64 65 73 63 7d | 7b 74 65 78 74 63 72 65 |uncdesc}|{textcre|
|00003450| 61 74 65 7d 7b 72 65 63 | 74 7d 0d 43 72 65 61 74 |ate}{rec|t}.Creat|
|00003460| 65 20 61 20 74 65 78 74 | 2d 65 64 69 74 20 6f 62 |e a text|-edit ob|
|00003470| 6a 65 63 74 20 69 6e 20 | 74 68 65 20 64 6f 63 75 |ject in |the docu|
|00003480| 6d 65 6e 74 20 61 74 20 | 74 68 65 20 67 69 76 65 |ment at |the give|
|00003490| 6e 20 72 65 63 74 61 6e | 67 6c 65 2e 0d 4d 65 74 |n rectan|gle..Met|
|000034a0| 68 6f 64 73 20 6f 66 20 | 74 65 78 74 2d 65 64 69 |hods of |text-edi|
|000034b0| 74 20 6f 62 6a 65 63 74 | 73 20 61 72 65 20 64 65 |t object|s are de|
|000034c0| 73 63 72 69 62 65 64 20 | 62 65 6c 6f 77 2e 0d 5c |scribed |below..\|
|000034d0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|000034e0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|000034f0| 73 65 74 61 63 74 69 76 | 65 7d 7b 7d 0d 41 74 74 |setactiv|e}{}.Att|
|00003500| 65 6d 70 74 20 74 6f 20 | 6d 61 6b 65 20 74 68 69 |empt to |make thi|
|00003510| 73 20 77 69 6e 64 6f 77 | 20 74 68 65 20 61 63 74 |s window| the act|
|00003520| 69 76 65 20 77 69 6e 64 | 6f 77 2e 20 20 49 66 20 |ive wind|ow. If |
|00003530| 73 75 63 63 65 73 73 66 | 75 6c 2c 20 74 68 69 73 |successf|ul, this|
|00003540| 0d 77 69 6c 6c 20 67 65 | 6e 65 72 61 74 65 20 61 |.will ge|nerate a|
|00003550| 20 57 45 5f 41 43 54 49 | 56 41 54 45 20 65 76 65 | WE_ACTI|VATE eve|
|00003560| 6e 74 20 28 61 6e 64 20 | 61 20 57 45 5f 44 45 41 |nt (and |a WE_DEA|
|00003570| 43 54 49 56 41 54 45 20 | 65 76 65 6e 74 20 69 6e |CTIVATE |event in|
|00003580| 20 63 61 73 65 0d 61 6e | 6f 74 68 65 72 20 77 69 | case.an|other wi|
|00003590| 6e 64 6f 77 20 69 6e 20 | 74 68 69 73 20 61 70 70 |ndow in |this app|
|000035a0| 6c 69 63 61 74 69 6f 6e | 20 62 65 63 61 6d 65 20 |lication| became |
|000035b0| 69 6e 61 63 74 69 76 65 | 29 2e 0d 5c 65 6e 64 7b |inactive|)..\end{|
|000035c0| 66 75 6e 63 64 65 73 63 | 7d 0d 0d 5c 62 65 67 69 |funcdesc|}..\begi|
|000035d0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 63 6c 6f 73 |n{funcde|sc}{clos|
|000035e0| 65 7d 7b 7d 0d 44 69 73 | 63 61 72 64 20 74 68 65 |e}{}.Dis|card the|
|000035f0| 20 77 69 6e 64 6f 77 20 | 6f 62 6a 65 63 74 2e 20 | window |object. |
|00003600| 20 49 74 20 73 68 6f 75 | 6c 64 20 6e 6f 74 20 62 | It shou|ld not b|
|00003610| 65 20 75 73 65 64 20 61 | 67 61 69 6e 2e 0d 5c 65 |e used a|gain..\e|
|00003620| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 73 |nd{funcd|esc}..\s|
|00003630| 75 62 73 65 63 74 69 6f | 6e 7b 44 72 61 77 69 6e |ubsectio|n{Drawin|
|00003640| 67 20 4f 62 6a 65 63 74 | 20 4d 65 74 68 6f 64 73 |g Object| Methods|
|00003650| 7d 0d 0d 44 72 61 77 69 | 6e 67 20 6f 62 6a 65 63 |}..Drawi|ng objec|
|00003660| 74 73 20 61 72 65 20 63 | 72 65 61 74 65 64 20 65 |ts are c|reated e|
|00003670| 78 63 6c 75 73 69 76 65 | 6c 79 20 62 79 20 74 68 |xclusive|ly by th|
|00003680| 65 20 77 69 6e 64 6f 77 | 20 6d 65 74 68 6f 64 0d |e window| method.|
|00003690| 5c 63 6f 64 65 7b 62 65 | 67 69 6e 64 72 61 77 69 |\code{be|gindrawi|
|000036a0| 6e 67 28 29 7d 2e 0d 4f | 6e 6c 79 20 6f 6e 65 20 |ng()}..O|nly one |
|000036b0| 64 72 61 77 69 6e 67 20 | 6f 62 6a 65 63 74 20 63 |drawing |object c|
|000036c0| 61 6e 20 65 78 69 73 74 | 20 61 74 20 61 6e 79 20 |an exist| at any |
|000036d0| 67 69 76 65 6e 20 74 69 | 6d 65 3b 20 74 68 65 20 |given ti|me; the |
|000036e0| 64 72 61 77 69 6e 67 20 | 6f 62 6a 65 63 74 0d 6d |drawing |object.m|
|000036f0| 75 73 74 20 62 65 20 64 | 65 6c 65 74 65 64 20 74 |ust be d|eleted t|
|00003700| 6f 20 66 69 6e 69 73 68 | 20 64 72 61 77 69 6e 67 |o finish| drawing|
|00003710| 2e 0d 4e 6f 20 64 72 61 | 77 69 6e 67 20 6f 62 6a |..No dra|wing obj|
|00003720| 65 63 74 20 6d 61 79 20 | 65 78 69 73 74 20 77 68 |ect may |exist wh|
|00003730| 65 6e 0d 5c 63 6f 64 65 | 7b 73 74 64 77 69 6e 2e |en.\code|{stdwin.|
|00003740| 67 65 74 65 76 65 6e 74 | 28 29 7d 0d 69 73 20 63 |getevent|()}.is c|
|00003750| 61 6c 6c 65 64 2e 0d 44 | 72 61 77 69 6e 67 20 6f |alled..D|rawing o|
|00003760| 62 6a 65 63 74 73 20 68 | 61 76 65 20 74 68 65 20 |bjects h|ave the |
|00003770| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 65 74 68 6f 64 |followin|g method|
|00003780| 73 3a 0d 0d 5c 72 65 6e | 65 77 63 6f 6d 6d 61 6e |s:..\ren|ewcomman|
|00003790| 64 7b 5c 69 6e 64 65 78 | 73 75 62 69 74 65 6d 7d |d{\index|subitem}|
|000037a0| 7b 28 64 72 61 77 69 6e | 67 20 6d 65 74 68 6f 64 |{(drawin|g method|
|000037b0| 29 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |)}..\beg|in{funcd|
|000037c0| 65 73 63 7d 7b 62 6f 78 | 7d 7b 72 65 63 74 7d 0d |esc}{box|}{rect}.|
|000037d0| 44 72 61 77 20 61 20 62 | 6f 78 20 6a 75 73 74 20 |Draw a b|ox just |
|000037e0| 69 6e 73 69 64 65 20 61 | 20 72 65 63 74 61 6e 67 |inside a| rectang|
|000037f0| 6c 65 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |le..\end|{funcdes|
|00003800| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00003810| 65 73 63 7d 7b 63 69 72 | 63 6c 65 7d 7b 63 65 6e |esc}{cir|cle}{cen|
|00003820| 74 65 72 5c 2c 20 72 61 | 64 69 75 73 7d 0d 44 72 |ter\, ra|dius}.Dr|
|00003830| 61 77 20 61 20 63 69 72 | 63 6c 65 20 77 69 74 68 |aw a cir|cle with|
|00003840| 20 67 69 76 65 6e 20 63 | 65 6e 74 65 72 20 70 6f | given c|enter po|
|00003850| 69 6e 74 20 61 6e 64 20 | 72 61 64 69 75 73 2e 0d |int and |radius..|
|00003860| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0d 0d |\end{fun|cdesc}..|
|00003870| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00003880| 7b 65 6c 61 72 63 7d 7b | 63 65 6e 74 65 72 5c 2c |{elarc}{|center\,|
|00003890| 20 5c 28 72 68 5c 2c 20 | 72 76 5c 29 5c 2c 20 5c | \(rh\, |rv\)\, \|
|000038a0| 28 61 31 5c 2c 20 61 32 | 5c 29 7d 0d 44 72 61 77 |(a1\, a2|\)}.Draw|
|000038b0| 20 61 6e 20 65 6c 6c 69 | 70 74 69 63 61 6c 20 61 | an elli|ptical a|
|000038c0| 72 63 20 77 69 74 68 20 | 67 69 76 65 6e 20 63 65 |rc with |given ce|
|000038d0| 6e 74 65 72 20 70 6f 69 | 6e 74 2e 0d 5c 63 6f 64 |nter poi|nt..\cod|
|000038e0| 65 7b 28 5c 76 61 72 7b | 72 68 7d 2c 20 5c 76 61 |e{(\var{|rh}, \va|
|000038f0| 72 7b 72 76 7d 29 7d 0d | 67 69 76 65 73 20 74 68 |r{rv})}.|gives th|
|00003900| 65 20 68 61 6c 66 20 73 | 69 7a 65 73 20 6f 66 20 |e half s|izes of |
|00003910| 74 68 65 20 68 6f 72 69 | 7a 6f 6e 74 61 6c 20 61 |the hori|zontal a|
|00003920| 6e 64 20 76 65 72 74 69 | 63 61 6c 20 72 61 64 69 |nd verti|cal radi|
|00003930| 69 2e 0d 5c 63 6f 64 65 | 7b 28 5c 76 61 72 7b 61 |i..\code|{(\var{a|
|00003940| 31 7d 2c 20 5c 76 61 72 | 7b 61 32 7d 29 7d 0d 67 |1}, \var|{a2})}.g|
|00003950| 69 76 65 73 20 74 68 65 | 20 61 6e 67 6c 65 73 20 |ives the| angles |
|00003960| 28 69 6e 20 64 65 67 72 | 65 65 73 29 20 6f 66 20 |(in degr|ees) of |
|00003970| 74 68 65 20 62 65 67 69 | 6e 20 61 6e 64 20 65 6e |the begi|n and en|
|00003980| 64 20 70 6f 69 6e 74 73 | 2e 0d 30 20 64 65 67 72 |d points|..0 degr|
|00003990| 65 65 73 20 69 73 20 61 | 74 20 33 20 6f 27 63 6c |ees is a|t 3 o'cl|
|000039a0| 6f 63 6b 2c 20 39 30 20 | 64 65 67 72 65 65 73 20 |ock, 90 |degrees |
|000039b0| 69 73 20 61 74 20 31 32 | 20 6f 27 63 6c 6f 63 6b |is at 12| o'clock|
|000039c0| 2e 0d 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|000039d0| 0d 0d 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|000039e0| 63 7d 7b 65 72 61 73 65 | 7d 7b 72 65 63 74 7d 0d |c}{erase|}{rect}.|
|000039f0| 45 72 61 73 65 20 61 20 | 72 65 63 74 61 6e 67 6c |Erase a |rectangl|
|00003a00| 65 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |e..\end{|funcdesc|
|00003a10| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00003a20| 73 63 7d 7b 66 69 6c 6c | 63 69 72 63 6c 65 7d 7b |sc}{fill|circle}{|
|00003a30| 63 65 6e 74 65 72 5c 2c | 20 72 61 64 69 75 73 7d |center\,| radius}|
|00003a40| 0d 44 72 61 77 20 61 20 | 66 69 6c 6c 65 64 20 63 |.Draw a |filled c|
|00003a50| 69 72 63 6c 65 20 77 69 | 74 68 20 67 69 76 65 6e |ircle wi|th given|
|00003a60| 20 63 65 6e 74 65 72 20 | 70 6f 69 6e 74 20 61 6e | center |point an|
|00003a70| 64 20 72 61 64 69 75 73 | 2e 0d 5c 65 6e 64 7b 66 |d radius|..\end{f|
|00003a80| 75 6e 63 64 65 73 63 7d | 0d 0d 5c 62 65 67 69 6e |uncdesc}|..\begin|
|00003a90| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 66 69 6c 6c 65 |{funcdes|c}{fille|
|00003aa0| 6c 61 72 63 7d 7b 63 65 | 6e 74 65 72 5c 2c 20 5c |larc}{ce|nter\, \|
|00003ab0| 28 72 68 5c 2c 20 72 76 | 5c 29 5c 2c 20 5c 28 61 |(rh\, rv|\)\, \(a|
|00003ac0| 31 5c 2c 20 61 32 5c 29 | 7d 0d 44 72 61 77 20 61 |1\, a2\)|}.Draw a|
|00003ad0| 20 66 69 6c 6c 65 64 20 | 65 6c 6c 69 70 74 69 63 | filled |elliptic|
|00003ae0| 61 6c 20 61 72 63 3b 20 | 61 72 67 75 6d 65 6e 74 |al arc; |argument|
|00003af0| 73 20 61 73 20 66 6f 72 | 20 5c 63 6f 64 65 7b 65 |s as for| \code{e|
|00003b00| 6c 61 72 63 7d 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |larc}..\|end{func|
|00003b10| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00003b20| 6e 63 64 65 73 63 7d 7b | 66 69 6c 6c 70 6f 6c 79 |ncdesc}{|fillpoly|
|00003b30| 7d 7b 70 6f 69 6e 74 73 | 7d 0d 44 72 61 77 20 61 |}{points|}.Draw a|
|00003b40| 20 66 69 6c 6c 65 64 20 | 70 6f 6c 79 67 6f 6e 20 | filled |polygon |
|00003b50| 67 69 76 65 6e 20 62 79 | 20 61 20 6c 69 73 74 20 |given by| a list |
|00003b60| 28 6f 72 20 74 75 70 6c | 65 29 20 6f 66 20 70 6f |(or tupl|e) of po|
|00003b70| 69 6e 74 73 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |ints..\e|nd{funcd|
|00003b80| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00003b90| 63 64 65 73 63 7d 7b 69 | 6e 76 65 72 74 7d 7b 72 |cdesc}{i|nvert}{r|
|00003ba0| 65 63 74 7d 0d 49 6e 76 | 65 72 74 20 61 20 72 65 |ect}.Inv|ert a re|
|00003bb0| 63 74 61 6e 67 6c 65 2e | 0d 5c 65 6e 64 7b 66 75 |ctangle.|.\end{fu|
|00003bc0| 6e 63 64 65 73 63 7d 0d | 0d 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00003bd0| 66 75 6e 63 64 65 73 63 | 7d 7b 6c 69 6e 65 7d 7b |funcdesc|}{line}{|
|00003be0| 70 31 5c 2c 20 70 32 7d | 0d 44 72 61 77 20 61 20 |p1\, p2}|.Draw a |
|00003bf0| 6c 69 6e 65 20 66 72 6f | 6d 20 70 6f 69 6e 74 0d |line fro|m point.|
|00003c00| 5c 76 61 72 7b 70 31 7d | 0d 74 6f 0d 5c 76 61 72 |\var{p1}|.to.\var|
|00003c10| 7b 70 32 7d 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |{p2}..\e|nd{funcd|
|00003c20| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00003c30| 63 64 65 73 63 7d 7b 70 | 61 69 6e 74 7d 7b 72 65 |cdesc}{p|aint}{re|
|00003c40| 63 74 7d 0d 46 69 6c 6c | 20 61 20 72 65 63 74 61 |ct}.Fill| a recta|
|00003c50| 6e 67 6c 65 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |ngle..\e|nd{funcd|
|00003c60| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00003c70| 63 64 65 73 63 7d 7b 70 | 6f 6c 79 7d 7b 70 6f 69 |cdesc}{p|oly}{poi|
|00003c80| 6e 74 73 7d 0d 44 72 61 | 77 20 74 68 65 20 6c 69 |nts}.Dra|w the li|
|00003c90| 6e 65 73 20 63 6f 6e 6e | 65 63 74 69 6e 67 20 74 |nes conn|ecting t|
|00003ca0| 68 65 20 67 69 76 65 6e | 20 6c 69 73 74 20 28 6f |he given| list (o|
|00003cb0| 72 20 74 75 70 6c 65 29 | 20 6f 66 20 70 6f 69 6e |r tuple)| of poin|
|00003cc0| 74 73 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |ts..\end|{funcdes|
|00003cd0| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00003ce0| 65 73 63 7d 7b 73 68 61 | 64 65 7d 7b 72 65 63 74 |esc}{sha|de}{rect|
|00003cf0| 5c 2c 20 70 65 72 63 65 | 6e 74 7d 0d 46 69 6c 6c |\, perce|nt}.Fill|
|00003d00| 20 61 20 72 65 63 74 61 | 6e 67 6c 65 20 77 69 74 | a recta|ngle wit|
|00003d10| 68 20 61 20 73 68 61 64 | 69 6e 67 20 70 61 74 74 |h a shad|ing patt|
|00003d20| 65 72 6e 20 74 68 61 74 | 20 69 73 20 61 62 6f 75 |ern that| is abou|
|00003d30| 74 0d 5c 76 61 72 7b 70 | 65 72 63 65 6e 74 7d 0d |t.\var{p|ercent}.|
|00003d40| 70 65 72 63 65 6e 74 20 | 66 69 6c 6c 65 64 2e 0d |percent |filled..|
|00003d50| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0d 0d |\end{fun|cdesc}..|
|00003d60| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00003d70| 7b 74 65 78 74 7d 7b 70 | 5c 2c 20 73 74 72 7d 0d |{text}{p|\, str}.|
|00003d80| 44 72 61 77 20 61 20 73 | 74 72 69 6e 67 20 73 74 |Draw a s|tring st|
|00003d90| 61 72 74 69 6e 67 20 61 | 74 20 70 6f 69 6e 74 20 |arting a|t point |
|00003da0| 70 20 28 74 68 65 20 70 | 6f 69 6e 74 20 73 70 65 |p (the p|oint spe|
|00003db0| 63 69 66 69 65 73 20 74 | 68 65 0d 74 6f 70 20 6c |cifies t|he.top l|
|00003dc0| 65 66 74 20 63 6f 6f 72 | 64 69 6e 61 74 65 20 6f |eft coor|dinate o|
|00003dd0| 66 20 74 68 65 20 73 74 | 72 69 6e 67 29 2e 0d 5c |f the st|ring)..\|
|00003de0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00003df0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00003e00| 78 6f 72 63 69 72 63 6c | 65 7d 7b 63 65 6e 74 65 |xorcircl|e}{cente|
|00003e10| 72 5c 2c 20 72 61 64 69 | 75 73 7d 0d 5c 66 75 6e |r\, radi|us}.\fun|
|00003e20| 63 6c 69 6e 65 7b 78 6f | 72 65 6c 61 72 63 7d 7b |cline{xo|relarc}{|
|00003e30| 63 65 6e 74 65 72 5c 2c | 20 5c 28 72 68 5c 2c 20 |center\,| \(rh\, |
|00003e40| 72 76 5c 29 5c 2c 20 5c | 28 61 31 5c 2c 20 61 32 |rv\)\, \|(a1\, a2|
|00003e50| 5c 29 7d 0d 5c 66 75 6e | 63 6c 69 6e 65 7b 78 6f |\)}.\fun|cline{xo|
|00003e60| 72 6c 69 6e 65 7d 7b 70 | 31 5c 2c 20 70 32 7d 0d |rline}{p|1\, p2}.|
|00003e70| 5c 66 75 6e 63 6c 69 6e | 65 7b 78 6f 72 70 6f 6c |\funclin|e{xorpol|
|00003e80| 79 7d 7b 70 6f 69 6e 74 | 73 7d 0d 44 72 61 77 20 |y}{point|s}.Draw |
|00003e90| 61 20 63 69 72 63 6c 65 | 2c 20 61 6e 20 65 6c 6c |a circle|, an ell|
|00003ea0| 69 70 74 69 63 61 6c 20 | 61 72 63 2c 20 61 20 6c |iptical |arc, a l|
|00003eb0| 69 6e 65 20 6f 72 20 61 | 20 70 6f 6c 79 67 6f 6e |ine or a| polygon|
|00003ec0| 2c 20 72 65 73 70 65 63 | 74 69 76 65 6c 79 2c 0d |, respec|tively,.|
|00003ed0| 69 6e 20 58 4f 52 20 6d | 6f 64 65 2e 0d 5c 65 6e |in XOR m|ode..\en|
|00003ee0| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00003ef0| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|00003f00| 74 66 67 63 6f 6c 6f 72 | 7d 7b 7d 0d 5c 66 75 6e |tfgcolor|}{}.\fun|
|00003f10| 63 6c 69 6e 65 7b 73 65 | 74 62 67 63 6f 6c 6f 72 |cline{se|tbgcolor|
|00003f20| 7d 7b 7d 0d 5c 66 75 6e | 63 6c 69 6e 65 7b 67 65 |}{}.\fun|cline{ge|
|00003f30| 74 66 67 63 6f 6c 6f 72 | 7d 7b 7d 0d 5c 66 75 6e |tfgcolor|}{}.\fun|
|00003f40| 63 6c 69 6e 65 7b 67 65 | 74 62 67 63 6f 6c 6f 72 |cline{ge|tbgcolor|
|00003f50| 7d 7b 7d 0d 54 68 65 73 | 65 20 66 75 6e 63 74 69 |}{}.Thes|e functi|
|00003f60| 6f 6e 73 20 61 72 65 20 | 73 69 6d 69 6c 61 72 20 |ons are |similar |
|00003f70| 74 6f 20 74 68 65 20 63 | 6f 72 72 65 73 70 6f 6e |to the c|orrespon|
|00003f80| 64 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 73 20 64 |ding fun|ctions d|
|00003f90| 65 73 63 72 69 62 65 64 | 0d 61 62 6f 76 65 20 66 |escribed|.above f|
|00003fa0| 6f 72 20 74 68 65 0d 5c | 63 6f 64 65 7b 73 74 64 |or the.\|code{std|
|00003fb0| 77 69 6e 7d 0d 6d 6f 64 | 75 6c 65 2c 20 62 75 74 |win}.mod|ule, but|
|00003fc0| 20 61 66 66 65 63 74 20 | 6f 72 20 72 65 74 75 72 | affect |or retur|
|00003fd0| 6e 20 74 68 65 20 63 6f | 6c 6f 72 73 20 63 75 72 |n the co|lors cur|
|00003fe0| 72 65 6e 74 6c 79 20 75 | 73 65 64 20 66 6f 72 20 |rently u|sed for |
|00003ff0| 64 72 61 77 69 6e 67 0d | 69 6e 73 74 65 61 64 20 |drawing.|instead |
|00004000| 6f 66 20 74 68 65 20 67 | 6c 6f 62 61 6c 20 64 65 |of the g|lobal de|
|00004010| 66 61 75 6c 74 20 63 6f | 6c 6f 72 73 2e 0d 57 68 |fault co|lors..Wh|
|00004020| 65 6e 20 61 20 64 72 61 | 77 69 6e 67 20 6f 62 6a |en a dra|wing obj|
|00004030| 65 63 74 20 69 73 20 63 | 72 65 61 74 65 64 2c 20 |ect is c|reated, |
|00004040| 69 74 73 20 63 6f 6c 6f | 72 73 20 61 72 65 20 73 |its colo|rs are s|
|00004050| 65 74 20 74 6f 20 74 68 | 65 20 77 69 6e 64 6f 77 |et to th|e window|
|00004060| 27 73 0d 64 65 66 61 75 | 6c 74 20 63 6f 6c 6f 72 |'s.defau|lt color|
|00004070| 73 2c 20 77 68 69 63 68 | 20 61 72 65 20 69 6e 20 |s, which| are in |
|00004080| 74 75 72 6e 20 69 6e 69 | 74 69 61 6c 69 7a 65 64 |turn ini|tialized|
|00004090| 20 66 72 6f 6d 20 74 68 | 65 20 67 6c 6f 62 61 6c | from th|e global|
|000040a0| 20 64 65 66 61 75 6c 74 | 0d 63 6f 6c 6f 72 73 20 | default|.colors |
|000040b0| 77 68 65 6e 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |when the| window |
|000040c0| 69 73 20 63 72 65 61 74 | 65 64 2e 0d 5c 65 6e 64 |is creat|ed..\end|
|000040d0| 7b 66 75 6e 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |{funcdes|c}..\beg|
|000040e0| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 73 65 74 |in{funcd|esc}{set|
|000040f0| 66 6f 6e 74 7d 7b 7d 0d | 5c 66 75 6e 63 6c 69 6e |font}{}.|\funclin|
|00004100| 65 7b 62 61 73 65 6c 69 | 6e 65 7d 7b 7d 0d 5c 66 |e{baseli|ne}{}.\f|
|00004110| 75 6e 63 6c 69 6e 65 7b | 6c 69 6e 65 68 65 69 67 |uncline{|lineheig|
|00004120| 68 74 7d 7b 7d 0d 5c 66 | 75 6e 63 6c 69 6e 65 7b |ht}{}.\f|uncline{|
|00004130| 74 65 78 74 62 72 65 61 | 6b 7d 7b 7d 0d 5c 66 75 |textbrea|k}{}.\fu|
|00004140| 6e 63 6c 69 6e 65 7b 74 | 65 78 74 77 69 64 74 68 |ncline{t|extwidth|
|00004150| 7d 7b 7d 0d 54 68 65 73 | 65 20 66 75 6e 63 74 69 |}{}.Thes|e functi|
|00004160| 6f 6e 73 20 61 72 65 20 | 73 69 6d 69 6c 61 72 20 |ons are |similar |
|00004170| 74 6f 20 74 68 65 20 63 | 6f 72 72 65 73 70 6f 6e |to the c|orrespon|
|00004180| 64 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 73 20 64 |ding fun|ctions d|
|00004190| 65 73 63 72 69 62 65 64 | 0d 61 62 6f 76 65 20 66 |escribed|.above f|
|000041a0| 6f 72 20 74 68 65 0d 5c | 63 6f 64 65 7b 73 74 64 |or the.\|code{std|
|000041b0| 77 69 6e 7d 0d 6d 6f 64 | 75 6c 65 2c 20 62 75 74 |win}.mod|ule, but|
|000041c0| 20 61 66 66 65 63 74 20 | 6f 72 20 75 73 65 20 74 | affect |or use t|
|000041d0| 68 65 20 63 75 72 72 65 | 6e 74 20 64 72 61 77 69 |he curre|nt drawi|
|000041e0| 6e 67 20 66 6f 6e 74 20 | 69 6e 73 74 65 61 64 20 |ng font |instead |
|000041f0| 6f 66 0d 74 68 65 20 67 | 6c 6f 62 61 6c 20 64 65 |of.the g|lobal de|
|00004200| 66 61 75 6c 74 20 66 6f | 6e 74 2e 0d 57 68 65 6e |fault fo|nt..When|
|00004210| 20 61 20 64 72 61 77 69 | 6e 67 20 6f 62 6a 65 63 | a drawi|ng objec|
|00004220| 74 20 69 73 20 63 72 65 | 61 74 65 64 2c 20 69 74 |t is cre|ated, it|
|00004230| 73 20 66 6f 6e 74 20 69 | 73 20 73 65 74 20 74 6f |s font i|s set to|
|00004240| 20 74 68 65 20 77 69 6e | 64 6f 77 27 73 0d 64 65 | the win|dow's.de|
|00004250| 66 61 75 6c 74 20 66 6f | 6e 74 2c 20 77 68 69 63 |fault fo|nt, whic|
|00004260| 68 20 69 73 20 69 6e 20 | 74 75 72 6e 20 69 6e 69 |h is in |turn ini|
|00004270| 74 69 61 6c 69 7a 65 64 | 20 66 72 6f 6d 20 74 68 |tialized| from th|
|00004280| 65 20 67 6c 6f 62 61 6c | 20 64 65 66 61 75 6c 74 |e global| default|
|00004290| 0d 66 6f 6e 74 20 77 68 | 65 6e 20 74 68 65 20 77 |.font wh|en the w|
|000042a0| 69 6e 64 6f 77 20 69 73 | 20 63 72 65 61 74 65 64 |indow is| created|
|000042b0| 2e 0d 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|000042c0| 0d 0d 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|000042d0| 63 7d 7b 62 69 74 6d 61 | 70 7d 7b 70 6f 69 6e 74 |c}{bitma|p}{point|
|000042e0| 5c 2c 20 62 69 74 6d 61 | 70 5c 2c 20 6d 61 73 6b |\, bitma|p\, mask|
|000042f0| 7d 0d 44 72 61 77 20 74 | 68 65 20 5c 76 61 72 7b |}.Draw t|he \var{|
|00004300| 62 69 74 6d 61 70 7d 20 | 77 69 74 68 20 69 74 73 |bitmap} |with its|
|00004310| 20 74 6f 70 20 6c 65 66 | 74 20 63 6f 72 6e 65 72 | top lef|t corner|
|00004320| 20 61 74 20 5c 76 61 72 | 7b 70 6f 69 6e 74 7d 2e | at \var|{point}.|
|00004330| 0d 49 66 20 74 68 65 20 | 6f 70 74 69 6f 6e 61 6c |.If the |optional|
|00004340| 20 5c 76 61 72 7b 6d 61 | 73 6b 7d 20 61 72 67 75 | \var{ma|sk} argu|
|00004350| 6d 65 6e 74 20 69 73 20 | 70 72 65 73 65 6e 74 2c |ment is |present,|
|00004360| 20 69 74 20 73 68 6f 75 | 6c 64 20 62 65 20 65 69 | it shou|ld be ei|
|00004370| 74 68 65 72 0d 74 68 65 | 20 73 61 6d 65 20 6f 62 |ther.the| same ob|
|00004380| 6a 65 63 74 20 61 73 20 | 5c 76 61 72 7b 62 69 74 |ject as |\var{bit|
|00004390| 6d 61 70 7d 2c 20 74 6f | 20 64 72 61 77 20 6f 6e |map}, to| draw on|
|000043a0| 6c 79 20 74 68 6f 73 65 | 20 62 69 74 73 20 74 68 |ly those| bits th|
|000043b0| 61 74 20 61 72 65 20 73 | 65 74 0d 69 6e 20 74 68 |at are s|et.in th|
|000043c0| 65 20 62 69 74 6d 61 70 | 2c 20 69 6e 20 74 68 65 |e bitmap|, in the|
|000043d0| 20 66 6f 72 65 67 72 6f | 75 6e 64 20 63 6f 6c 6f | foregro|und colo|
|000043e0| 72 2c 20 6f 72 20 5c 63 | 6f 64 65 7b 4e 6f 6e 65 |r, or \c|ode{None|
|000043f0| 7d 2c 20 74 6f 20 64 72 | 61 77 20 61 6c 6c 0d 62 |}, to dr|aw all.b|
|00004400| 69 74 73 20 28 6f 6e 65 | 73 20 61 72 65 20 64 72 |its (one|s are dr|
|00004410| 61 77 6e 20 69 6e 20 74 | 68 65 20 66 6f 72 65 67 |awn in t|he foreg|
|00004420| 72 6f 75 6e 64 20 63 6f | 6c 6f 72 2c 20 7a 65 72 |round co|lor, zer|
|00004430| 6f 73 20 69 6e 20 74 68 | 65 20 62 61 63 6b 67 72 |os in th|e backgr|
|00004440| 6f 75 6e 64 0d 63 6f 6c | 6f 72 29 2e 0d 5c 65 6e |ound.col|or)..\en|
|00004450| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00004460| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 63 6c |gin{func|desc}{cl|
|00004470| 69 70 72 65 63 74 7d 7b | 72 65 63 74 7d 0d 53 65 |iprect}{|rect}.Se|
|00004480| 74 20 74 68 65 20 60 60 | 63 6c 69 70 70 69 6e 67 |t the ``|clipping|
|00004490| 20 72 65 67 69 6f 6e 27 | 27 20 74 6f 20 61 20 72 | region'|' to a r|
|000044a0| 65 63 74 61 6e 67 6c 65 | 2e 0d 54 68 65 20 63 6c |ectangle|..The cl|
|000044b0| 69 70 70 69 6e 67 20 72 | 65 67 69 6f 6e 20 6c 69 |ipping r|egion li|
|000044c0| 6d 69 74 73 20 74 68 65 | 20 65 66 66 65 63 74 20 |mits the| effect |
|000044d0| 6f 66 20 61 6c 6c 20 64 | 72 61 77 69 6e 67 20 6f |of all d|rawing o|
|000044e0| 70 65 72 61 74 69 6f 6e | 73 2c 20 75 6e 74 69 6c |peration|s, until|
|000044f0| 0d 69 74 20 69 73 20 63 | 68 61 6e 67 65 64 20 61 |.it is c|hanged a|
|00004500| 67 61 69 6e 20 6f 72 20 | 75 6e 74 69 6c 20 74 68 |gain or |until th|
|00004510| 65 20 64 72 61 77 69 6e | 67 20 6f 62 6a 65 63 74 |e drawin|g object|
|00004520| 20 69 73 20 63 6c 6f 73 | 65 64 2e 20 20 57 68 65 | is clos|ed. Whe|
|00004530| 6e 20 61 0d 64 72 61 77 | 69 6e 67 20 6f 62 6a 65 |n a.draw|ing obje|
|00004540| 63 74 20 69 73 20 63 72 | 65 61 74 65 64 20 74 68 |ct is cr|eated th|
|00004550| 65 20 63 6c 69 70 70 69 | 6e 67 20 72 65 67 69 6f |e clippi|ng regio|
|00004560| 6e 20 69 73 20 73 65 74 | 20 74 6f 20 74 68 65 20 |n is set| to the |
|00004570| 65 6e 74 69 72 65 0d 77 | 69 6e 64 6f 77 2e 20 20 |entire.w|indow. |
|00004580| 57 68 65 6e 20 61 6e 20 | 6f 62 6a 65 63 74 20 74 |When an |object t|
|00004590| 6f 20 62 65 20 64 72 61 | 77 6e 20 66 61 6c 6c 73 |o be dra|wn falls|
|000045a0| 20 70 61 72 74 6c 79 20 | 6f 75 74 73 69 64 65 20 | partly |outside |
|000045b0| 74 68 65 20 63 6c 69 70 | 70 69 6e 67 0d 72 65 67 |the clip|ping.reg|
|000045c0| 69 6f 6e 2c 20 74 68 65 | 20 73 65 74 20 6f 66 20 |ion, the| set of |
|000045d0| 70 69 78 65 6c 73 20 64 | 72 61 77 6e 20 69 73 20 |pixels d|rawn is |
|000045e0| 74 68 65 20 69 6e 74 65 | 72 73 65 63 74 69 6f 6e |the inte|rsection|
|000045f0| 20 6f 66 20 74 68 65 20 | 63 6c 69 70 70 69 6e 67 | of the |clipping|
|00004600| 0d 72 65 67 69 6f 6e 20 | 61 6e 64 20 74 68 65 20 |.region |and the |
|00004610| 73 65 74 20 6f 66 20 70 | 69 78 65 6c 73 20 74 68 |set of p|ixels th|
|00004620| 61 74 20 77 6f 75 6c 64 | 20 62 65 20 64 72 61 77 |at would| be draw|
|00004630| 6e 20 62 79 20 74 68 65 | 20 73 61 6d 65 20 6f 70 |n by the| same op|
|00004640| 65 72 61 74 69 6f 6e 0d | 69 6e 20 74 68 65 20 61 |eration.|in the a|
|00004650| 62 73 65 6e 63 65 20 6f | 66 20 61 20 63 6c 69 70 |bsence o|f a clip|
|00004660| 70 69 6e 67 20 72 65 67 | 69 6f 6e 2e 0d 5c 65 6e |ping reg|ion..\en|
|00004670| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00004680| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 6e 6f |gin{func|desc}{no|
|00004690| 63 6c 69 70 7d 7b 7d 0d | 52 65 73 65 74 20 74 68 |clip}{}.|Reset th|
|000046a0| 65 20 63 6c 69 70 70 69 | 6e 67 20 72 65 67 69 6f |e clippi|ng regio|
|000046b0| 6e 20 74 6f 20 74 68 65 | 20 65 6e 74 69 72 65 20 |n to the| entire |
|000046c0| 77 69 6e 64 6f 77 2e 0d | 5c 65 6e 64 7b 66 75 6e |window..|\end{fun|
|000046d0| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|000046e0| 75 6e 63 64 65 73 63 7d | 7b 63 6c 6f 73 65 7d 7b |uncdesc}|{close}{|
|000046f0| 7d 0d 5c 66 75 6e 63 6c | 69 6e 65 7b 65 6e 64 64 |}.\funcl|ine{endd|
|00004700| 72 61 77 69 6e 67 7d 7b | 7d 0d 44 69 73 63 61 72 |rawing}{|}.Discar|
|00004710| 64 20 74 68 65 20 64 72 | 61 77 69 6e 67 20 6f 62 |d the dr|awing ob|
|00004720| 6a 65 63 74 2e 20 20 49 | 74 20 73 68 6f 75 6c 64 |ject. I|t should|
|00004730| 20 6e 6f 74 20 62 65 20 | 75 73 65 64 20 61 67 61 | not be |used aga|
|00004740| 69 6e 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |in..\end|{funcdes|
|00004750| 63 7d 0d 0d 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |c}..\sub|section{|
|00004760| 4d 65 6e 75 20 4f 62 6a | 65 63 74 20 4d 65 74 68 |Menu Obj|ect Meth|
|00004770| 6f 64 73 7d 0d 0d 41 20 | 6d 65 6e 75 20 6f 62 6a |ods}..A |menu obj|
|00004780| 65 63 74 20 72 65 70 72 | 65 73 65 6e 74 73 20 61 |ect repr|esents a|
|00004790| 20 6d 65 6e 75 2e 0d 54 | 68 65 20 6d 65 6e 75 20 | menu..T|he menu |
|000047a0| 69 73 20 64 65 73 74 72 | 6f 79 65 64 20 77 68 65 |is destr|oyed whe|
|000047b0| 6e 20 74 68 65 20 6d 65 | 6e 75 20 6f 62 6a 65 63 |n the me|nu objec|
|000047c0| 74 20 69 73 20 64 65 6c | 65 74 65 64 2e 0d 54 68 |t is del|eted..Th|
|000047d0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 6d 65 74 68 |e follow|ing meth|
|000047e0| 6f 64 73 20 61 72 65 20 | 64 65 66 69 6e 65 64 3a |ods are |defined:|
|000047f0| 0d 0d 5c 72 65 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b |..\renew|command{|
|00004800| 5c 69 6e 64 65 78 73 75 | 62 69 74 65 6d 7d 7b 28 |\indexsu|bitem}{(|
|00004810| 6d 65 6e 75 20 6d 65 74 | 68 6f 64 29 7d 0d 0d 5c |menu met|hod)}..\|
|00004820| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00004830| 61 64 64 69 74 65 6d 7d | 7b 74 65 78 74 5c 2c 20 |additem}|{text\, |
|00004840| 73 68 6f 72 74 63 75 74 | 7d 0d 41 64 64 20 61 20 |shortcut|}.Add a |
|00004850| 6d 65 6e 75 20 69 74 65 | 6d 20 77 69 74 68 20 67 |menu ite|m with g|
|00004860| 69 76 65 6e 20 74 65 78 | 74 2e 0d 54 68 65 20 73 |iven tex|t..The s|
|00004870| 68 6f 72 74 63 75 74 20 | 6d 75 73 74 20 62 65 20 |hortcut |must be |
|00004880| 61 20 73 74 72 69 6e 67 | 20 6f 66 20 6c 65 6e 67 |a string| of leng|
|00004890| 74 68 20 31 2c 20 6f 72 | 20 6f 6d 69 74 74 65 64 |th 1, or| omitted|
|000048a0| 20 28 74 6f 20 73 70 65 | 63 69 66 79 20 6e 6f 0d | (to spe|cify no.|
|000048b0| 73 68 6f 72 74 63 75 74 | 29 2e 0d 5c 65 6e 64 7b |shortcut|)..\end{|
|000048c0| 66 75 6e 63 64 65 73 63 | 7d 0d 0d 5c 62 65 67 69 |funcdesc|}..\begi|
|000048d0| 6e 7b 66 75 6e 63 64 65 | 73 63 7d 7b 73 65 74 69 |n{funcde|sc}{seti|
|000048e0| 74 65 6d 7d 7b 69 5c 2c | 20 74 65 78 74 7d 0d 53 |tem}{i\,| text}.S|
|000048f0| 65 74 20 74 68 65 20 74 | 65 78 74 20 6f 66 20 69 |et the t|ext of i|
|00004900| 74 65 6d 20 6e 75 6d 62 | 65 72 0d 5c 76 61 72 7b |tem numb|er.\var{|
|00004910| 69 7d 2e 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |i}..\end|{funcdes|
|00004920| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00004930| 65 73 63 7d 7b 65 6e 61 | 62 6c 65 7d 7b 69 5c 2c |esc}{ena|ble}{i\,|
|00004940| 20 66 6c 61 67 7d 0d 45 | 6e 61 62 6c 65 20 6f 72 | flag}.E|nable or|
|00004950| 20 64 69 73 61 62 6c 65 | 73 20 69 74 65 6d 0d 5c | disable|s item.\|
|00004960| 76 61 72 7b 69 7d 2e 0d | 5c 65 6e 64 7b 66 75 6e |var{i}..|\end{fun|
|00004970| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00004980| 75 6e 63 64 65 73 63 7d | 7b 63 68 65 63 6b 7d 7b |uncdesc}|{check}{|
|00004990| 69 5c 2c 20 66 6c 61 67 | 7d 0d 53 65 74 20 6f 72 |i\, flag|}.Set or|
|000049a0| 20 63 6c 65 61 72 20 74 | 68 65 0d 5c 64 66 6e 7b | clear t|he.\dfn{|
|000049b0| 63 68 65 63 6b 20 6d 61 | 72 6b 7d 0d 66 6f 72 20 |check ma|rk}.for |
|000049c0| 69 74 65 6d 0d 5c 76 61 | 72 7b 69 7d 2e 0d 5c 65 |item.\va|r{i}..\e|
|000049d0| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0d 0d 5c 62 |nd{funcd|esc}..\b|
|000049e0| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 63 |egin{fun|cdesc}{c|
|000049f0| 6c 6f 73 65 7d 7b 7d 0d | 44 69 73 63 61 72 64 20 |lose}{}.|Discard |
|00004a00| 74 68 65 20 6d 65 6e 75 | 20 6f 62 6a 65 63 74 2e |the menu| object.|
|00004a10| 20 20 49 74 20 73 68 6f | 75 6c 64 20 6e 6f 74 20 | It sho|uld not |
|00004a20| 62 65 20 75 73 65 64 20 | 61 67 61 69 6e 2e 0d 5c |be used |again..\|
|00004a30| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0d 0d 5c |end{func|desc}..\|
|00004a40| 73 75 62 73 65 63 74 69 | 6f 6e 7b 42 69 74 6d 61 |subsecti|on{Bitma|
|00004a50| 70 20 4f 62 6a 65 63 74 | 20 4d 65 74 68 6f 64 73 |p Object| Methods|
|00004a60| 7d 0d 0d 41 20 62 69 74 | 6d 61 70 20 72 65 70 72 |}..A bit|map repr|
|00004a70| 65 73 65 6e 74 73 20 61 | 20 72 65 63 74 61 6e 67 |esents a| rectang|
|00004a80| 75 6c 61 72 20 61 72 72 | 61 79 20 6f 66 20 62 69 |ular arr|ay of bi|
|00004a90| 74 73 2e 0d 54 68 65 20 | 74 6f 70 20 6c 65 66 74 |ts..The |top left|
|00004aa0| 20 62 69 74 20 68 61 73 | 20 63 6f 6f 72 64 69 6e | bit has| coordin|
|00004ab0| 61 74 65 20 28 30 2c 20 | 30 29 2e 0d 41 20 62 69 |ate (0, |0)..A bi|
|00004ac0| 74 6d 61 70 20 63 61 6e | 20 62 65 20 64 72 61 77 |tmap can| be draw|
|00004ad0| 6e 20 77 69 74 68 20 74 | 68 65 20 5c 63 6f 64 65 |n with t|he \code|
|00004ae0| 7b 62 69 74 6d 61 70 7d | 20 6d 65 74 68 6f 64 20 |{bitmap}| method |
|00004af0| 6f 66 20 61 20 64 72 61 | 77 69 6e 67 20 6f 62 6a |of a dra|wing obj|
|00004b00| 65 63 74 2e 0d 54 68 65 | 20 66 6f 6c 6c 6f 77 69 |ect..The| followi|
|00004b10| 6e 67 20 6d 65 74 68 6f | 64 73 20 61 72 65 20 64 |ng metho|ds are d|
|00004b20| 65 66 69 6e 65 64 3a 0d | 0d 5c 72 65 6e 65 77 63 |efined:.|.\renewc|
|00004b30| 6f 6d 6d 61 6e 64 7b 5c | 69 6e 64 65 78 73 75 62 |ommand{\|indexsub|
|00004b40| 69 74 65 6d 7d 7b 28 62 | 69 74 6d 61 70 20 6d 65 |item}{(b|itmap me|
|00004b50| 74 68 6f 64 29 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |thod)}..|\begin{f|
|00004b60| 75 6e 63 64 65 73 63 7d | 7b 67 65 74 73 69 7a 65 |uncdesc}|{getsize|
|00004b70| 7d 7b 7d 0d 52 65 74 75 | 72 6e 20 61 20 74 75 70 |}{}.Retu|rn a tup|
|00004b80| 6c 65 20 72 65 70 72 65 | 73 65 6e 74 69 6e 67 20 |le repre|senting |
|00004b90| 74 68 65 20 77 69 64 74 | 68 20 61 6e 64 20 68 65 |the widt|h and he|
|00004ba0| 69 67 68 74 20 6f 66 20 | 74 68 65 20 62 69 74 6d |ight of |the bitm|
|00004bb0| 61 70 2e 0d 28 54 68 69 | 73 20 72 65 74 75 72 6e |ap..(Thi|s return|
|00004bc0| 73 20 74 68 65 20 76 61 | 6c 75 65 73 20 74 68 61 |s the va|lues tha|
|00004bd0| 74 20 68 61 76 65 20 62 | 65 65 6e 20 70 61 73 73 |t have b|een pass|
|00004be0| 65 64 20 74 6f 20 74 68 | 65 20 5c 63 6f 64 65 7b |ed to th|e \code{|
|00004bf0| 6e 65 77 62 69 74 6d 61 | 70 7d 0d 66 75 6e 63 74 |newbitma|p}.funct|
|00004c00| 69 6f 6e 2e 29 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |ion.).\e|nd{funcd|
|00004c10| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00004c20| 63 64 65 73 63 7d 7b 73 | 65 74 62 69 74 7d 7b 70 |cdesc}{s|etbit}{p|
|00004c30| 6f 69 6e 74 5c 2c 20 62 | 69 74 7d 0d 53 65 74 20 |oint\, b|it}.Set |
|00004c40| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |the valu|e of the|
|00004c50| 20 62 69 74 20 69 6e 64 | 69 63 61 74 65 64 20 62 | bit ind|icated b|
|00004c60| 79 20 5c 76 61 72 7b 70 | 6f 69 6e 74 7d 20 74 6f |y \var{p|oint} to|
|00004c70| 20 5c 76 61 72 7b 62 69 | 74 7d 2e 0d 5c 65 6e 64 | \var{bi|t}..\end|
|00004c80| 7b 66 75 6e 63 64 65 73 | 63 7d 0d 0d 5c 62 65 67 |{funcdes|c}..\beg|
|00004c90| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 67 65 74 |in{funcd|esc}{get|
|00004ca0| 62 69 74 7d 7b 70 6f 69 | 6e 74 7d 0d 52 65 74 75 |bit}{poi|nt}.Retu|
|00004cb0| 72 6e 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |rn the v|alue of |
|00004cc0| 74 68 65 20 62 69 74 20 | 69 6e 64 69 63 61 74 65 |the bit |indicate|
|00004cd0| 64 20 62 79 20 5c 76 61 | 72 7b 70 6f 69 6e 74 7d |d by \va|r{point}|
|00004ce0| 2e 0d 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00004cf0| 0d 0d 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00004d00| 63 7d 7b 63 6c 6f 73 65 | 7d 7b 7d 0d 44 69 73 63 |c}{close|}{}.Disc|
|00004d10| 61 72 64 20 74 68 65 20 | 62 69 74 6d 61 70 20 6f |ard the |bitmap o|
|00004d20| 62 6a 65 63 74 2e 20 20 | 49 74 20 73 68 6f 75 6c |bject. |It shoul|
|00004d30| 64 20 6e 6f 74 20 62 65 | 20 75 73 65 64 20 61 67 |d not be| used ag|
|00004d40| 61 69 6e 2e 0d 5c 65 6e | 64 7b 66 75 6e 63 64 65 |ain..\en|d{funcde|
|00004d50| 73 63 7d 0d 0d 5c 73 75 | 62 73 65 63 74 69 6f 6e |sc}..\su|bsection|
|00004d60| 7b 54 65 78 74 2d 65 64 | 69 74 20 4f 62 6a 65 63 |{Text-ed|it Objec|
|00004d70| 74 20 4d 65 74 68 6f 64 | 73 7d 0d 0d 41 20 74 65 |t Method|s}..A te|
|00004d80| 78 74 2d 65 64 69 74 20 | 6f 62 6a 65 63 74 20 72 |xt-edit |object r|
|00004d90| 65 70 72 65 73 65 6e 74 | 73 20 61 20 74 65 78 74 |epresent|s a text|
|00004da0| 2d 65 64 69 74 20 62 6c | 6f 63 6b 2e 0d 46 6f 72 |-edit bl|ock..For|
|00004db0| 20 73 65 6d 61 6e 74 69 | 63 73 2c 20 73 65 65 20 | semanti|cs, see |
|00004dc0| 74 68 65 20 53 54 44 57 | 49 4e 20 64 6f 63 75 6d |the STDW|IN docum|
|00004dd0| 65 6e 74 61 74 69 6f 6e | 20 66 6f 72 20 43 20 70 |entation| for C p|
|00004de0| 72 6f 67 72 61 6d 6d 65 | 72 73 2e 0d 54 68 65 20 |rogramme|rs..The |
|00004df0| 66 6f 6c 6c 6f 77 69 6e | 67 20 6d 65 74 68 6f 64 |followin|g method|
|00004e00| 73 20 65 78 69 73 74 3a | 0d 0d 5c 72 65 6e 65 77 |s exist:|..\renew|
|00004e10| 63 6f 6d 6d 61 6e 64 7b | 5c 69 6e 64 65 78 73 75 |command{|\indexsu|
|00004e20| 62 69 74 65 6d 7d 7b 28 | 74 65 78 74 2d 65 64 69 |bitem}{(|text-edi|
|00004e30| 74 20 6d 65 74 68 6f 64 | 29 7d 0d 0d 5c 62 65 67 |t method|)}..\beg|
|00004e40| 69 6e 7b 66 75 6e 63 64 | 65 73 63 7d 7b 61 72 72 |in{funcd|esc}{arr|
|00004e50| 6f 77 7d 7b 63 6f 64 65 | 7d 0d 50 61 73 73 20 61 |ow}{code|}.Pass a|
|00004e60| 6e 20 61 72 72 6f 77 20 | 65 76 65 6e 74 20 74 6f |n arrow |event to|
|00004e70| 20 74 68 65 20 74 65 78 | 74 2d 65 64 69 74 20 62 | the tex|t-edit b|
|00004e80| 6c 6f 63 6b 2e 0d 54 68 | 65 0d 5c 76 61 72 7b 63 |lock..Th|e.\var{c|
|00004e90| 6f 64 65 7d 0d 6d 75 73 | 74 20 62 65 20 6f 6e 65 |ode}.mus|t be one|
|00004ea0| 20 6f 66 0d 5c 63 6f 64 | 65 7b 57 43 5f 4c 45 46 | of.\cod|e{WC_LEF|
|00004eb0| 54 7d 2c 0d 5c 63 6f 64 | 65 7b 57 43 5f 52 49 47 |T},.\cod|e{WC_RIG|
|00004ec0| 48 54 7d 2c 0d 5c 63 6f | 64 65 7b 57 43 5f 55 50 |HT},.\co|de{WC_UP|
|00004ed0| 7d 0d 6f 72 0d 5c 63 6f | 64 65 7b 57 43 5f 44 4f |}.or.\co|de{WC_DO|
|00004ee0| 57 4e 7d 0d 28 73 65 65 | 20 6d 6f 64 75 6c 65 0d |WN}.(see| module.|
|00004ef0| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 65 76 65 6e |\code{st|dwineven|
|00004f00| 74 73 7d 29 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |ts})..\e|nd{funcd|
|00004f10| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00004f20| 63 64 65 73 63 7d 7b 64 | 72 61 77 7d 7b 72 65 63 |cdesc}{d|raw}{rec|
|00004f30| 74 7d 0d 50 61 73 73 20 | 61 20 64 72 61 77 20 65 |t}.Pass |a draw e|
|00004f40| 76 65 6e 74 20 74 6f 20 | 74 68 65 20 74 65 78 74 |vent to |the text|
|00004f50| 2d 65 64 69 74 20 62 6c | 6f 63 6b 2e 0d 54 68 65 |-edit bl|ock..The|
|00004f60| 20 72 65 63 74 61 6e 67 | 6c 65 20 73 70 65 63 69 | rectang|le speci|
|00004f70| 66 69 65 73 20 74 68 65 | 20 72 65 64 72 61 77 20 |fies the| redraw |
|00004f80| 61 72 65 61 2e 0d 5c 65 | 6e 64 7b 66 75 6e 63 64 |area..\e|nd{funcd|
|00004f90| 65 73 63 7d 0d 0d 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00004fa0| 63 64 65 73 63 7d 7b 65 | 76 65 6e 74 7d 7b 74 79 |cdesc}{e|vent}{ty|
|00004fb0| 70 65 5c 2c 20 77 69 6e | 64 6f 77 5c 2c 20 64 65 |pe\, win|dow\, de|
|00004fc0| 74 61 69 6c 7d 0d 50 61 | 73 73 20 61 6e 20 65 76 |tail}.Pa|ss an ev|
|00004fd0| 65 6e 74 20 67 6f 74 74 | 65 6e 20 66 72 6f 6d 0d |ent gott|en from.|
|00004fe0| 5c 63 6f 64 65 7b 73 74 | 64 77 69 6e 2e 67 65 74 |\code{st|dwin.get|
|00004ff0| 65 76 65 6e 74 28 29 7d | 0d 74 6f 20 74 68 65 20 |event()}|.to the |
|00005000| 74 65 78 74 2d 65 64 69 | 74 20 62 6c 6f 63 6b 2e |text-edi|t block.|
|00005010| 0d 52 65 74 75 72 6e 20 | 74 72 75 65 20 69 66 20 |.Return |true if |
|00005020| 74 68 65 20 65 76 65 6e | 74 20 77 61 73 20 68 61 |the even|t was ha|
|00005030| 6e 64 6c 65 64 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |ndled..\|end{func|
|00005040| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00005050| 6e 63 64 65 73 63 7d 7b | 67 65 74 66 6f 63 75 73 |ncdesc}{|getfocus|
|00005060| 7d 7b 7d 0d 52 65 74 75 | 72 6e 20 32 20 69 6e 74 |}{}.Retu|rn 2 int|
|00005070| 65 67 65 72 73 20 72 65 | 70 72 65 73 65 6e 74 69 |egers re|presenti|
|00005080| 6e 67 20 74 68 65 20 73 | 74 61 72 74 20 61 6e 64 |ng the s|tart and|
|00005090| 20 65 6e 64 20 70 6f 73 | 69 74 69 6f 6e 73 20 6f | end pos|itions o|
|000050a0| 66 20 74 68 65 0d 66 6f | 63 75 73 2c 20 75 73 61 |f the.fo|cus, usa|
|000050b0| 62 6c 65 20 61 73 20 73 | 6c 69 63 65 20 69 6e 64 |ble as s|lice ind|
|000050c0| 69 63 65 73 20 6f 6e 20 | 74 68 65 20 73 74 72 69 |ices on |the stri|
|000050d0| 6e 67 20 72 65 74 75 72 | 6e 65 64 20 62 79 0d 5c |ng retur|ned by.\|
|000050e0| 63 6f 64 65 7b 67 65 74 | 74 65 78 74 28 29 7d 2e |code{get|text()}.|
|000050f0| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00005100| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00005110| 7d 7b 67 65 74 66 6f 63 | 75 73 74 65 78 74 7d 7b |}{getfoc|ustext}{|
|00005120| 7d 0d 52 65 74 75 72 6e | 20 74 68 65 20 74 65 78 |}.Return| the tex|
|00005130| 74 20 69 6e 20 74 68 65 | 20 66 6f 63 75 73 2e 0d |t in the| focus..|
|00005140| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0d 0d |\end{fun|cdesc}..|
|00005150| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00005160| 7b 67 65 74 72 65 63 74 | 7d 7b 7d 0d 52 65 74 75 |{getrect|}{}.Retu|
|00005170| 72 6e 20 61 20 72 65 63 | 74 61 6e 67 6c 65 20 67 |rn a rec|tangle g|
|00005180| 69 76 69 6e 67 20 74 68 | 65 20 61 63 74 75 61 6c |iving th|e actual|
|00005190| 20 70 6f 73 69 74 69 6f | 6e 20 6f 66 20 74 68 65 | positio|n of the|
|000051a0| 20 74 65 78 74 2d 65 64 | 69 74 20 62 6c 6f 63 6b | text-ed|it block|
|000051b0| 2e 0d 28 54 68 65 20 62 | 6f 74 74 6f 6d 20 63 6f |..(The b|ottom co|
|000051c0| 6f 72 64 69 6e 61 74 65 | 20 6d 61 79 20 64 69 66 |ordinate| may dif|
|000051d0| 66 65 72 20 66 72 6f 6d | 20 74 68 65 20 69 6e 69 |fer from| the ini|
|000051e0| 74 69 61 6c 20 70 6f 73 | 69 74 69 6f 6e 20 62 65 |tial pos|ition be|
|000051f0| 63 61 75 73 65 0d 74 68 | 65 20 62 6c 6f 63 6b 20 |cause.th|e block |
|00005200| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 73 68 |automati|cally sh|
|00005210| 72 69 6e 6b 73 20 6f 72 | 20 67 72 6f 77 73 20 74 |rinks or| grows t|
|00005220| 6f 20 66 69 74 2e 29 0d | 5c 65 6e 64 7b 66 75 6e |o fit.).|\end{fun|
|00005230| 63 64 65 73 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 66 |cdesc}..|\begin{f|
|00005240| 75 6e 63 64 65 73 63 7d | 7b 67 65 74 74 65 78 74 |uncdesc}|{gettext|
|00005250| 7d 7b 7d 0d 52 65 74 75 | 72 6e 20 74 68 65 20 65 |}{}.Retu|rn the e|
|00005260| 6e 74 69 72 65 20 74 65 | 78 74 20 62 75 66 66 65 |ntire te|xt buffe|
|00005270| 72 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |r..\end{|funcdesc|
|00005280| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|00005290| 73 63 7d 7b 6d 6f 76 65 | 7d 7b 72 65 63 74 7d 0d |sc}{move|}{rect}.|
|000052a0| 53 70 65 63 69 66 79 20 | 61 20 6e 65 77 20 70 6f |Specify |a new po|
|000052b0| 73 69 74 69 6f 6e 20 66 | 6f 72 20 74 68 65 20 74 |sition f|or the t|
|000052c0| 65 78 74 2d 65 64 69 74 | 20 62 6c 6f 63 6b 20 69 |ext-edit| block i|
|000052d0| 6e 20 74 68 65 20 64 6f | 63 75 6d 65 6e 74 2e 0d |n the do|cument..|
|000052e0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0d 0d |\end{fun|cdesc}..|
|000052f0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00005300| 7b 72 65 70 6c 61 63 65 | 7d 7b 73 74 72 7d 0d 52 |{replace|}{str}.R|
|00005310| 65 70 6c 61 63 65 20 74 | 68 65 20 74 65 78 74 20 |eplace t|he text |
|00005320| 69 6e 20 74 68 65 20 66 | 6f 63 75 73 20 62 79 20 |in the f|ocus by |
|00005330| 74 68 65 20 67 69 76 65 | 6e 20 73 74 72 69 6e 67 |the give|n string|
|00005340| 2e 0d 54 68 65 20 6e 65 | 77 20 66 6f 63 75 73 20 |..The ne|w focus |
|00005350| 69 73 20 61 6e 20 69 6e | 73 65 72 74 20 70 6f 69 |is an in|sert poi|
|00005360| 6e 74 20 61 74 20 74 68 | 65 20 65 6e 64 20 6f 66 |nt at th|e end of|
|00005370| 20 74 68 65 20 73 74 72 | 69 6e 67 2e 0d 5c 65 6e | the str|ing..\en|
|00005380| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00005390| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 73 65 |gin{func|desc}{se|
|000053a0| 74 66 6f 63 75 73 7d 7b | 69 5c 2c 20 6a 7d 0d 53 |tfocus}{|i\, j}.S|
|000053b0| 70 65 63 69 66 79 20 74 | 68 65 20 6e 65 77 20 66 |pecify t|he new f|
|000053c0| 6f 63 75 73 2e 0d 4f 75 | 74 2d 6f 66 2d 62 6f 75 |ocus..Ou|t-of-bou|
|000053d0| 6e 64 73 20 76 61 6c 75 | 65 73 20 61 72 65 20 73 |nds valu|es are s|
|000053e0| 69 6c 65 6e 74 6c 79 20 | 63 6c 69 70 70 65 64 2e |ilently |clipped.|
|000053f0| 0d 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0d |.\end{fu|ncdesc}.|
|00005400| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00005410| 7d 7b 73 65 74 74 65 78 | 74 7d 7b 73 74 72 7d 0d |}{settex|t}{str}.|
|00005420| 52 65 70 6c 61 63 65 20 | 74 68 65 20 65 6e 74 69 |Replace |the enti|
|00005430| 72 65 20 74 65 78 74 20 | 62 75 66 66 65 72 20 62 |re text |buffer b|
|00005440| 79 20 74 68 65 20 67 69 | 76 65 6e 20 73 74 72 69 |y the gi|ven stri|
|00005450| 6e 67 20 61 6e 64 20 73 | 65 74 20 74 68 65 20 66 |ng and s|et the f|
|00005460| 6f 63 75 73 0d 74 6f 20 | 5c 63 6f 64 65 7b 28 30 |ocus.to |\code{(0|
|00005470| 2c 20 30 29 7d 2e 0d 5c | 65 6e 64 7b 66 75 6e 63 |, 0)}..\|end{func|
|00005480| 64 65 73 63 7d 0d 0d 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00005490| 6e 63 64 65 73 63 7d 7b | 73 65 74 76 69 65 77 7d |ncdesc}{|setview}|
|000054a0| 7b 72 65 63 74 7d 0d 53 | 65 74 20 74 68 65 20 76 |{rect}.S|et the v|
|000054b0| 69 65 77 20 72 65 63 74 | 61 6e 67 6c 65 20 74 6f |iew rect|angle to|
|000054c0| 20 5c 76 61 72 7b 72 65 | 63 74 7d 2e 20 20 49 66 | \var{re|ct}. If|
|000054d0| 20 5c 76 61 72 7b 72 65 | 63 74 7d 20 69 73 20 5c | \var{re|ct} is \|
|000054e0| 63 6f 64 65 7b 4e 6f 6e | 65 7d 2c 0d 76 69 65 77 |code{Non|e},.view|
|000054f0| 69 6e 67 20 6d 6f 64 65 | 20 69 73 20 72 65 73 65 |ing mode| is rese|
|00005500| 74 2e 20 20 49 6e 20 76 | 69 65 77 69 6e 67 20 6d |t. In v|iewing m|
|00005510| 6f 64 65 2c 20 61 6c 6c | 20 6f 75 74 70 75 74 20 |ode, all| output |
|00005520| 66 72 6f 6d 20 74 68 65 | 20 74 65 78 74 2d 65 64 |from the| text-ed|
|00005530| 69 74 0d 6f 62 6a 65 63 | 74 20 69 73 20 63 6c 69 |it.objec|t is cli|
|00005540| 70 70 65 64 20 74 6f 20 | 74 68 65 20 76 69 65 77 |pped to |the view|
|00005550| 69 6e 67 20 72 65 63 74 | 61 6e 67 6c 65 2e 20 20 |ing rect|angle. |
|00005560| 54 68 69 73 20 6d 61 79 | 20 62 65 20 75 73 65 66 |This may| be usef|
|00005570| 75 6c 20 74 6f 0d 69 6d | 70 6c 65 6d 65 6e 74 20 |ul to.im|plement |
|00005580| 79 6f 75 72 20 6f 77 6e | 20 73 63 72 6f 6c 6c 69 |your own| scrolli|
|00005590| 6e 67 20 74 65 78 74 20 | 73 75 62 77 69 6e 64 6f |ng text |subwindo|
|000055a0| 77 2e 0d 5c 65 6e 64 7b | 66 75 6e 63 64 65 73 63 |w..\end{|funcdesc|
|000055b0| 7d 0d 0d 5c 62 65 67 69 | 6e 7b 66 75 6e 63 64 65 |}..\begi|n{funcde|
|000055c0| 73 63 7d 7b 63 6c 6f 73 | 65 7d 7b 7d 0d 44 69 73 |sc}{clos|e}{}.Dis|
|000055d0| 63 61 72 64 20 74 68 65 | 20 74 65 78 74 2d 65 64 |card the| text-ed|
|000055e0| 69 74 20 6f 62 6a 65 63 | 74 2e 20 20 49 74 20 73 |it objec|t. It s|
|000055f0| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 75 73 65 |hould no|t be use|
|00005600| 64 20 61 67 61 69 6e 2e | 0d 5c 65 6e 64 7b 66 75 |d again.|.\end{fu|
|00005610| 6e 63 64 65 73 63 7d 0d | 0d 5c 73 75 62 73 65 63 |ncdesc}.|.\subsec|
|00005620| 74 69 6f 6e 7b 45 78 61 | 6d 70 6c 65 7d 0d 5c 6e |tion{Exa|mple}.\n|
|00005630| 6f 64 65 6e 61 6d 65 7b | 53 74 64 77 69 6e 20 45 |odename{|Stdwin E|
|00005640| 78 61 6d 70 6c 65 7d 0d | 0d 48 65 72 65 20 69 73 |xample}.|.Here is|
|00005650| 20 61 20 6d 69 6e 69 6d | 61 6c 20 65 78 61 6d 70 | a minim|al examp|
|00005660| 6c 65 20 6f 66 20 75 73 | 69 6e 67 20 53 54 44 57 |le of us|ing STDW|
|00005670| 49 4e 20 69 6e 20 50 79 | 74 68 6f 6e 2e 0d 49 74 |IN in Py|thon..It|
|00005680| 20 63 72 65 61 74 65 73 | 20 61 20 77 69 6e 64 6f | creates| a windo|
|00005690| 77 20 61 6e 64 20 64 72 | 61 77 73 20 74 68 65 20 |w and dr|aws the |
|000056a0| 73 74 72 69 6e 67 20 60 | 60 48 65 6c 6c 6f 20 77 |string `|`Hello w|
|000056b0| 6f 72 6c 64 27 27 20 69 | 6e 20 74 68 65 20 74 6f |orld'' i|n the to|
|000056c0| 70 0d 6c 65 66 74 20 63 | 6f 72 6e 65 72 20 6f 66 |p.left c|orner of|
|000056d0| 20 74 68 65 20 77 69 6e | 64 6f 77 2e 0d 54 68 65 | the win|dow..The|
|000056e0| 20 77 69 6e 64 6f 77 20 | 77 69 6c 6c 20 62 65 20 | window |will be |
|000056f0| 63 6f 72 72 65 63 74 6c | 79 20 72 65 64 72 61 77 |correctl|y redraw|
|00005700| 6e 20 77 68 65 6e 20 63 | 6f 76 65 72 65 64 20 61 |n when c|overed a|
|00005710| 6e 64 20 72 65 2d 65 78 | 70 6f 73 65 64 2e 0d 54 |nd re-ex|posed..T|
|00005720| 68 65 20 70 72 6f 67 72 | 61 6d 20 71 75 69 74 73 |he progr|am quits|
|00005730| 20 77 68 65 6e 20 74 68 | 65 20 63 6c 6f 73 65 20 | when th|e close |
|00005740| 69 63 6f 6e 20 6f 72 20 | 6d 65 6e 75 20 69 74 65 |icon or |menu ite|
|00005750| 6d 20 69 73 20 72 65 71 | 75 65 73 74 65 64 2e 0d |m is req|uested..|
|00005760| 0d 5c 62 63 6f 64 65 5c | 62 65 67 69 6e 7b 76 65 |.\bcode\|begin{ve|
|00005770| 72 62 61 74 69 6d 7d 0d | 69 6d 70 6f 72 74 20 73 |rbatim}.|import s|
|00005780| 74 64 77 69 6e 0d 66 72 | 6f 6d 20 73 74 64 77 69 |tdwin.fr|om stdwi|
|00005790| 6e 65 76 65 6e 74 73 20 | 69 6d 70 6f 72 74 20 2a |nevents |import *|
|000057a0| 0d 0d 64 65 66 20 6d 61 | 69 6e 28 29 3a 0d 20 20 |..def ma|in():. |
|000057b0| 20 20 6d 79 77 69 6e 20 | 3d 20 73 74 64 77 69 6e | mywin |= stdwin|
|000057c0| 2e 6f 70 65 6e 28 27 48 | 65 6c 6c 6f 27 29 0d 20 |.open('H|ello'). |
|000057d0| 20 20 20 23 0d 20 20 20 | 20 77 68 69 6c 65 20 31 | #. | while 1|
|000057e0| 3a 0d 20 20 20 20 20 20 | 20 20 28 74 79 70 65 2c |:. | (type,|
|000057f0| 20 77 69 6e 2c 20 64 65 | 74 61 69 6c 29 20 3d 20 | win, de|tail) = |
|00005800| 73 74 64 77 69 6e 2e 67 | 65 74 65 76 65 6e 74 28 |stdwin.g|etevent(|
|00005810| 29 0d 20 20 20 20 20 20 | 20 20 69 66 20 74 79 70 |). | if typ|
|00005820| 65 20 3d 3d 20 57 45 5f | 44 52 41 57 3a 0d 20 20 |e == WE_|DRAW:. |
|00005830| 20 20 20 20 20 20 20 20 | 20 20 64 72 61 77 20 3d | | draw =|
|00005840| 20 77 69 6e 2e 62 65 67 | 69 6e 64 72 61 77 69 6e | win.beg|indrawin|
|00005850| 67 28 29 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |g(). | |
|00005860| 64 72 61 77 2e 74 65 78 | 74 28 28 30 2c 20 30 29 |draw.tex|t((0, 0)|
|00005870| 2c 20 27 48 65 6c 6c 6f | 2c 20 77 6f 72 6c 64 27 |, 'Hello|, world'|
|00005880| 29 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 64 65 |). | de|
|00005890| 6c 20 64 72 61 77 0d 20 | 20 20 20 20 20 20 20 65 |l draw. | e|
|000058a0| 6c 69 66 20 74 79 70 65 | 20 3d 3d 20 57 45 5f 43 |lif type| == WE_C|
|000058b0| 4c 4f 53 45 3a 0d 20 20 | 20 20 20 20 20 20 20 20 |LOSE:. | |
|000058c0| 20 20 62 72 65 61 6b 0d | 0d 6d 61 69 6e 28 29 0d | break.|.main().|
|000058d0| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 5c 65 |\end{ver|batim}\e|
|000058e0| 63 6f 64 65 0d 0d 5c 73 | 65 63 74 69 6f 6e 7b 53 |code..\s|ection{S|
|000058f0| 74 61 6e 64 61 72 64 20 | 4d 6f 64 75 6c 65 20 5c |tandard |Module \|
|00005900| 73 65 63 74 63 6f 64 65 | 7b 73 74 64 77 69 6e 65 |sectcode|{stdwine|
|00005910| 76 65 6e 74 73 7d 7d 0d | 5c 73 74 6d 6f 64 69 6e |vents}}.|\stmodin|
|00005920| 64 65 78 7b 73 74 64 77 | 69 6e 65 76 65 6e 74 73 |dex{stdw|inevents|
|00005930| 7d 0d 0d 54 68 69 73 20 | 6d 6f 64 75 6c 65 20 64 |}..This |module d|
|00005940| 65 66 69 6e 65 73 20 63 | 6f 6e 73 74 61 6e 74 73 |efines c|onstants|
|00005950| 20 75 73 65 64 20 62 79 | 20 53 54 44 57 49 4e 20 | used by| STDWIN |
|00005960| 66 6f 72 20 65 76 65 6e | 74 20 74 79 70 65 73 0d |for even|t types.|
|00005970| 28 5c 63 6f 64 65 7b 57 | 45 5f 41 43 54 49 56 41 |(\code{W|E_ACTIVA|
|00005980| 54 45 7d 20 65 74 63 2e | 29 2c 20 63 6f 6d 6d 61 |TE} etc.|), comma|
|00005990| 6e 64 20 63 6f 64 65 73 | 20 28 5c 63 6f 64 65 7b |nd codes| (\code{|
|000059a0| 57 43 5f 4c 45 46 54 7d | 20 65 74 63 2e 29 0d 61 |WC_LEFT}| etc.).a|
|000059b0| 6e 64 20 73 65 6c 65 63 | 74 69 6f 6e 20 74 79 70 |nd selec|tion typ|
|000059c0| 65 73 20 28 5c 63 6f 64 | 65 7b 57 53 5f 50 52 49 |es (\cod|e{WS_PRI|
|000059d0| 4d 41 52 59 7d 20 65 74 | 63 2e 29 2e 0d 52 65 61 |MARY} et|c.)..Rea|
|000059e0| 64 20 74 68 65 20 66 69 | 6c 65 20 66 6f 72 20 64 |d the fi|le for d|
|000059f0| 65 74 61 69 6c 73 2e 0d | 53 75 67 67 65 73 74 65 |etails..|Suggeste|
|00005a00| 64 20 75 73 61 67 65 20 | 69 73 0d 0d 5c 62 63 6f |d usage |is..\bco|
|00005a10| 64 65 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |de\begin|{verbati|
|00005a20| 6d 7d 0d 3e 3e 3e 20 66 | 72 6f 6d 20 73 74 64 77 |m}.>>> f|rom stdw|
|00005a30| 69 6e 65 76 65 6e 74 73 | 20 69 6d 70 6f 72 74 20 |inevents| import |
|00005a40| 2a 0d 3e 3e 3e 20 0d 5c | 65 6e 64 7b 76 65 72 62 |*.>>> .\|end{verb|
|00005a50| 61 74 69 6d 7d 5c 65 63 | 6f 64 65 0d 0d 5c 73 65 |atim}\ec|ode..\se|
|00005a60| 63 74 69 6f 6e 7b 53 74 | 61 6e 64 61 72 64 20 4d |ction{St|andard M|
|00005a70| 6f 64 75 6c 65 20 5c 73 | 65 63 74 63 6f 64 65 7b |odule \s|ectcode{|
|00005a80| 72 65 63 74 7d 7d 0d 5c | 73 74 6d 6f 64 69 6e 64 |rect}}.\|stmodind|
|00005a90| 65 78 7b 72 65 63 74 7d | 0d 0d 54 68 69 73 20 6d |ex{rect}|..This m|
|00005aa0| 6f 64 75 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 75 |odule co|ntains u|
|00005ab0| 73 65 66 75 6c 20 6f 70 | 65 72 61 74 69 6f 6e 73 |seful op|erations|
|00005ac0| 20 6f 6e 20 72 65 63 74 | 61 6e 67 6c 65 73 2e 0d | on rect|angles..|
|00005ad0| 41 20 72 65 63 74 61 6e | 67 6c 65 20 69 73 20 64 |A rectan|gle is d|
|00005ae0| 65 66 69 6e 65 64 20 61 | 73 20 69 6e 20 6d 6f 64 |efined a|s in mod|
|00005af0| 75 6c 65 0d 5c 63 6f 64 | 65 7b 73 74 64 77 69 6e |ule.\cod|e{stdwin|
|00005b00| 7d 3a 0d 61 20 70 61 69 | 72 20 6f 66 20 70 6f 69 |}:.a pai|r of poi|
|00005b10| 6e 74 73 2c 20 77 68 65 | 72 65 20 61 20 70 6f 69 |nts, whe|re a poi|
|00005b20| 6e 74 20 69 73 20 61 20 | 70 61 69 72 20 6f 66 20 |nt is a |pair of |
|00005b30| 69 6e 74 65 67 65 72 73 | 2e 0d 46 6f 72 20 65 78 |integers|..For ex|
|00005b40| 61 6d 70 6c 65 2c 20 74 | 68 65 20 72 65 63 74 61 |ample, t|he recta|
|00005b50| 6e 67 6c 65 0d 0d 5c 62 | 63 6f 64 65 5c 62 65 67 |ngle..\b|code\beg|
|00005b60| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0d 28 31 30 |in{verba|tim}.(10|
|00005b70| 2c 20 32 30 29 2c 20 28 | 39 30 2c 20 38 30 29 0d |, 20), (|90, 80).|
|00005b80| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 5c 65 |\end{ver|batim}\e|
|00005b90| 63 6f 64 65 0d 0d 69 73 | 20 61 20 72 65 63 74 61 |code..is| a recta|
|00005ba0| 6e 67 6c 65 20 77 68 6f | 73 65 20 6c 65 66 74 2c |ngle who|se left,|
|00005bb0| 20 74 6f 70 2c 20 72 69 | 67 68 74 20 61 6e 64 20 | top, ri|ght and |
|00005bc0| 62 6f 74 74 6f 6d 20 65 | 64 67 65 73 20 61 72 65 |bottom e|dges are|
|00005bd0| 20 31 30 2c 20 32 30 2c | 20 39 30 0d 61 6e 64 20 | 10, 20,| 90.and |
|00005be0| 38 30 2c 20 72 65 73 70 | 65 63 74 69 76 65 6c 79 |80, resp|ectively|
|00005bf0| 2e 0d 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 20 |..Note t|hat the |
|00005c00| 70 6f 73 69 74 69 76 65 | 20 76 65 72 74 69 63 61 |positive| vertica|
|00005c10| 6c 20 61 78 69 73 20 70 | 6f 69 6e 74 73 20 64 6f |l axis p|oints do|
|00005c20| 77 6e 20 28 61 73 20 69 | 6e 0d 5c 63 6f 64 65 7b |wn (as i|n.\code{|
|00005c30| 73 74 64 77 69 6e 7d 29 | 2e 0d 0d 54 68 65 20 6d |stdwin})|...The m|
|00005c40| 6f 64 75 6c 65 20 64 65 | 66 69 6e 65 73 20 74 68 |odule de|fines th|
|00005c50| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 6f 62 6a 65 |e follow|ing obje|
|00005c60| 63 74 73 3a 0d 0d 5c 72 | 65 6e 65 77 63 6f 6d 6d |cts:..\r|enewcomm|
|00005c70| 61 6e 64 7b 5c 69 6e 64 | 65 78 73 75 62 69 74 65 |and{\ind|exsubite|
|00005c80| 6d 7d 7b 28 69 6e 20 6d | 6f 64 75 6c 65 20 72 65 |m}{(in m|odule re|
|00005c90| 63 74 29 7d 0d 5c 62 65 | 67 69 6e 7b 65 78 63 64 |ct)}.\be|gin{excd|
|00005ca0| 65 73 63 7d 7b 65 72 72 | 6f 72 7d 0d 54 68 65 20 |esc}{err|or}.The |
|00005cb0| 65 78 63 65 70 74 69 6f | 6e 20 72 61 69 73 65 64 |exceptio|n raised|
|00005cc0| 20 62 79 20 66 75 6e 63 | 74 69 6f 6e 73 20 69 6e | by func|tions in|
|00005cd0| 20 74 68 69 73 20 6d 6f | 64 75 6c 65 20 77 68 65 | this mo|dule whe|
|00005ce0| 6e 20 74 68 65 79 20 64 | 65 74 65 63 74 20 61 6e |n they d|etect an|
|00005cf0| 0d 65 72 72 6f 72 2e 0d | 54 68 65 20 65 78 63 65 |.error..|The exce|
|00005d00| 70 74 69 6f 6e 20 61 72 | 67 75 6d 65 6e 74 20 69 |ption ar|gument i|
|00005d10| 73 20 61 20 73 74 72 69 | 6e 67 20 64 65 73 63 72 |s a stri|ng descr|
|00005d20| 69 62 69 6e 67 20 74 68 | 65 20 70 72 6f 62 6c 65 |ibing th|e proble|
|00005d30| 6d 20 69 6e 20 6d 6f 72 | 65 0d 64 65 74 61 69 6c |m in mor|e.detail|
|00005d40| 2e 0d 5c 65 6e 64 7b 65 | 78 63 64 65 73 63 7d 0d |..\end{e|xcdesc}.|
|00005d50| 0d 5c 62 65 67 69 6e 7b | 64 61 74 61 64 65 73 63 |.\begin{|datadesc|
|00005d60| 7d 7b 65 6d 70 74 79 7d | 0d 54 68 65 20 72 65 63 |}{empty}|.The rec|
|00005d70| 74 61 6e 67 6c 65 20 72 | 65 74 75 72 6e 65 64 20 |tangle r|eturned |
|00005d80| 77 68 65 6e 20 73 6f 6d | 65 20 6f 70 65 72 61 74 |when som|e operat|
|00005d90| 69 6f 6e 73 20 72 65 74 | 75 72 6e 20 61 6e 20 65 |ions ret|urn an e|
|00005da0| 6d 70 74 79 20 72 65 73 | 75 6c 74 2e 0d 54 68 69 |mpty res|ult..Thi|
|00005db0| 73 20 6d 61 6b 65 73 20 | 69 74 20 70 6f 73 73 69 |s makes |it possi|
|00005dc0| 62 6c 65 20 74 6f 20 71 | 75 69 63 6b 6c 79 20 63 |ble to q|uickly c|
|00005dd0| 68 65 63 6b 20 77 68 65 | 74 68 65 72 20 61 20 72 |heck whe|ther a r|
|00005de0| 65 73 75 6c 74 20 69 73 | 20 65 6d 70 74 79 3a 0d |esult is| empty:.|
|00005df0| 0d 5c 62 63 6f 64 65 5c | 62 65 67 69 6e 7b 76 65 |.\bcode\|begin{ve|
|00005e00| 72 62 61 74 69 6d 7d 0d | 3e 3e 3e 20 69 6d 70 6f |rbatim}.|>>> impo|
|00005e10| 72 74 20 72 65 63 74 0d | 3e 3e 3e 20 72 31 20 3d |rt rect.|>>> r1 =|
|00005e20| 20 28 31 30 2c 20 32 30 | 29 2c 20 28 39 30 2c 20 | (10, 20|), (90, |
|00005e30| 38 30 29 0d 3e 3e 3e 20 | 72 32 20 3d 20 28 30 2c |80).>>> |r2 = (0,|
|00005e40| 20 30 29 2c 20 28 31 30 | 2c 20 32 30 29 0d 3e 3e | 0), (10|, 20).>>|
|00005e50| 3e 20 72 33 20 3d 20 72 | 65 63 74 2e 69 6e 74 65 |> r3 = r|ect.inte|
|00005e60| 72 73 65 63 74 28 5b 72 | 31 2c 20 72 32 5d 29 0d |rsect([r|1, r2]).|
|00005e70| 3e 3e 3e 20 69 66 20 72 | 33 20 69 73 20 72 65 63 |>>> if r|3 is rec|
|00005e80| 74 2e 65 6d 70 74 79 3a | 20 70 72 69 6e 74 20 27 |t.empty:| print '|
|00005e90| 45 6d 70 74 79 20 69 6e | 74 65 72 73 65 63 74 69 |Empty in|tersecti|
|00005ea0| 6f 6e 27 0d 45 6d 70 74 | 79 20 69 6e 74 65 72 73 |on'.Empt|y inters|
|00005eb0| 65 63 74 69 6f 6e 0d 3e | 3e 3e 20 0d 5c 65 6e 64 |ection.>|>> .\end|
|00005ec0| 7b 76 65 72 62 61 74 69 | 6d 7d 5c 65 63 6f 64 65 |{verbati|m}\ecode|
|00005ed0| 0d 5c 65 6e 64 7b 64 61 | 74 61 64 65 73 63 7d 0d |.\end{da|tadesc}.|
|00005ee0| 0d 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00005ef0| 7d 7b 69 73 5f 65 6d 70 | 74 79 7d 7b 72 7d 0d 52 |}{is_emp|ty}{r}.R|
|00005f00| 65 74 75 72 6e 73 20 74 | 72 75 65 20 69 66 20 74 |eturns t|rue if t|
|00005f10| 68 65 20 67 69 76 65 6e | 20 72 65 63 74 61 6e 67 |he given| rectang|
|00005f20| 6c 65 20 69 73 20 65 6d | 70 74 79 2e 0d 41 20 72 |le is em|pty..A r|
|00005f30| 65 63 74 61 6e 67 6c 65 | 0d 5c 63 6f 64 65 7b 28 |ectangle|.\code{(|
|00005f40| 5c 76 61 72 7b 6c 65 66 | 74 7d 2c 20 5c 76 61 72 |\var{lef|t}, \var|
|00005f50| 7b 74 6f 70 7d 29 2c 20 | 28 5c 76 61 72 7b 72 69 |{top}), |(\var{ri|
|00005f60| 67 68 74 7d 2c 20 5c 76 | 61 72 7b 62 6f 74 74 6f |ght}, \v|ar{botto|
|00005f70| 6d 7d 29 7d 0d 69 73 20 | 65 6d 70 74 79 20 69 66 |m})}.is |empty if|
|00005f80| 0d 5c 69 66 74 65 78 69 | 0d 5c 63 6f 64 65 7b 5c |.\iftexi|.\code{\|
|00005f90| 76 61 72 7b 6c 65 66 74 | 7d 20 3e 3d 20 5c 76 61 |var{left|} >= \va|
|00005fa0| 72 7b 72 69 67 68 74 7d | 7d 20 6f 72 20 5c 63 6f |r{right}|} or \co|
|00005fb0| 64 65 7b 5c 76 61 72 7b | 74 6f 70 7d 20 3d 3e 20 |de{\var{|top} => |
|00005fc0| 5c 76 61 72 7b 62 6f 74 | 74 6f 6d 7d 7d 2e 0d 5c |\var{bot|tom}}..\|
|00005fd0| 65 6c 73 65 0d 24 5c 76 | 61 72 7b 6c 65 66 74 7d |else.$\v|ar{left}|
|00005fe0| 20 5c 67 65 71 20 5c 76 | 61 72 7b 72 69 67 68 74 | \geq \v|ar{right|
|00005ff0| 7d 24 20 6f 72 20 24 5c | 76 61 72 7b 74 6f 70 7d |}$ or $\|var{top}|
|00006000| 20 5c 67 65 71 20 5c 76 | 61 72 7b 62 6f 74 74 6f | \geq \v|ar{botto|
|00006010| 6d 7d 24 2e 0d 25 25 4a | 48 58 58 58 7b 5c 65 6d |m}$..%%J|HXXX{\em|
|00006020| 20 6c 65 66 74 7e 24 5c | 67 65 71 24 7e 72 69 67 | left~$\|geq$~rig|
|00006030| 68 74 7d 20 6f 72 20 7b | 5c 65 6d 20 74 6f 70 7e |ht} or {|\em top~|
|00006040| 24 5c 6c 65 71 24 7e 62 | 6f 74 74 6f 6d 7d 2e 0d |$\leq$~b|ottom}..|
|00006050| 5c 66 69 0d 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |\fi.\end|{funcdes|
|00006060| 63 7d 0d 0d 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00006070| 65 73 63 7d 7b 69 6e 74 | 65 72 73 65 63 74 7d 7b |esc}{int|ersect}{|
|00006080| 6c 69 73 74 7d 0d 52 65 | 74 75 72 6e 73 20 74 68 |list}.Re|turns th|
|00006090| 65 20 69 6e 74 65 72 73 | 65 63 74 69 6f 6e 20 6f |e inters|ection o|
|000060a0| 66 20 61 6c 6c 20 72 65 | 63 74 61 6e 67 6c 65 73 |f all re|ctangles|
|000060b0| 20 69 6e 20 74 68 65 20 | 6c 69 73 74 20 61 72 67 | in the |list arg|
|000060c0| 75 6d 65 6e 74 2e 0d 49 | 74 20 6d 61 79 20 61 6c |ument..I|t may al|
|000060d0| 73 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 77 69 74 |so be ca|lled wit|
|000060e0| 68 20 61 20 74 75 70 6c | 65 20 61 72 67 75 6d 65 |h a tupl|e argume|
|000060f0| 6e 74 2e 0d 52 61 69 73 | 65 73 0d 5c 63 6f 64 65 |nt..Rais|es.\code|
|00006100| 7b 72 65 63 74 2e 65 72 | 72 6f 72 7d 0d 69 66 20 |{rect.er|ror}.if |
|00006110| 74 68 65 20 6c 69 73 74 | 20 69 73 20 65 6d 70 74 |the list| is empt|
|00006120| 79 2e 0d 52 65 74 75 72 | 6e 73 0d 5c 63 6f 64 65 |y..Retur|ns.\code|
|00006130| 7b 72 65 63 74 2e 65 6d | 70 74 79 7d 0d 69 66 20 |{rect.em|pty}.if |
|00006140| 74 68 65 20 69 6e 74 65 | 72 73 65 63 74 69 6f 6e |the inte|rsection|
|00006150| 20 6f 66 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c | of the |rectangl|
|00006160| 65 73 20 69 73 20 65 6d | 70 74 79 2e 0d 5c 65 6e |es is em|pty..\en|
|00006170| 64 7b 66 75 6e 63 64 65 | 73 63 7d 0d 0d 5c 62 65 |d{funcde|sc}..\be|
|00006180| 67 69 6e 7b 66 75 6e 63 | 64 65 73 63 7d 7b 75 6e |gin{func|desc}{un|
|00006190| 69 6f 6e 7d 7b 6c 69 73 | 74 7d 0d 52 65 74 75 72 |ion}{lis|t}.Retur|
|000061a0| 6e 73 20 74 68 65 20 73 | 6d 61 6c 6c 65 73 74 20 |ns the s|mallest |
|000061b0| 72 65 63 74 61 6e 67 6c | 65 20 74 68 61 74 20 63 |rectangl|e that c|
|000061c0| 6f 6e 74 61 69 6e 73 20 | 61 6c 6c 20 6e 6f 6e 2d |ontains |all non-|
|000061d0| 65 6d 70 74 79 20 72 65 | 63 74 61 6e 67 6c 65 73 |empty re|ctangles|
|000061e0| 20 69 6e 0d 74 68 65 20 | 6c 69 73 74 20 61 72 67 | in.the |list arg|
|000061f0| 75 6d 65 6e 74 2e 0d 49 | 74 20 6d 61 79 20 61 6c |ument..I|t may al|
|00006200| 73 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 77 69 74 |so be ca|lled wit|
|00006210| 68 20 61 20 74 75 70 6c | 65 20 61 72 67 75 6d 65 |h a tupl|e argume|
|00006220| 6e 74 20 6f 72 20 77 69 | 74 68 20 74 77 6f 20 6f |nt or wi|th two o|
|00006230| 72 20 6d 6f 72 65 0d 72 | 65 63 74 61 6e 67 6c 65 |r more.r|ectangle|
|00006240| 73 20 61 73 20 61 72 67 | 75 6d 65 6e 74 73 2e 0d |s as arg|uments..|
|00006250| 52 65 74 75 72 6e 73 0d | 5c 63 6f 64 65 7b 72 65 |Returns.|\code{re|
|00006260| 63 74 2e 65 6d 70 74 79 | 7d 0d 69 66 20 74 68 65 |ct.empty|}.if the|
|00006270| 20 6c 69 73 74 20 69 73 | 20 65 6d 70 74 79 20 6f | list is| empty o|
|00006280| 72 20 61 6c 6c 20 69 74 | 73 20 72 65 63 74 61 6e |r all it|s rectan|
|00006290| 67 6c 65 73 20 61 72 65 | 20 65 6d 70 74 79 2e 0d |gles are| empty..|
|000062a0| 5c 65 6e 64 7b 66 75 6e | 63 64 65 73 63 7d 0d 0d |\end{fun|cdesc}..|
|000062b0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|000062c0| 7b 70 6f 69 6e 74 69 6e | 72 65 63 74 7d 7b 70 6f |{pointin|rect}{po|
|000062d0| 69 6e 74 5c 2c 20 72 65 | 63 74 7d 0d 52 65 74 75 |int\, re|ct}.Retu|
|000062e0| 72 6e 73 20 74 72 75 65 | 20 69 66 20 74 68 65 20 |rns true| if the |
|000062f0| 70 6f 69 6e 74 20 69 73 | 20 69 6e 73 69 64 65 20 |point is| inside |
|00006300| 74 68 65 20 72 65 63 74 | 61 6e 67 6c 65 2e 0d 42 |the rect|angle..B|
|00006310| 79 20 64 65 66 69 6e 69 | 74 69 6f 6e 2c 20 61 20 |y defini|tion, a |
|00006320| 70 6f 69 6e 74 0d 5c 63 | 6f 64 65 7b 28 5c 76 61 |point.\c|ode{(\va|
|00006330| 72 7b 68 7d 2c 20 5c 76 | 61 72 7b 76 7d 29 7d 0d |r{h}, \v|ar{v})}.|
|00006340| 69 73 20 69 6e 73 69 64 | 65 20 61 20 72 65 63 74 |is insid|e a rect|
|00006350| 61 6e 67 6c 65 0d 5c 63 | 6f 64 65 7b 28 5c 76 61 |angle.\c|ode{(\va|
|00006360| 72 7b 6c 65 66 74 7d 2c | 20 5c 76 61 72 7b 74 6f |r{left},| \var{to|
|00006370| 70 7d 29 2c 20 28 5c 76 | 61 72 7b 72 69 67 68 74 |p}), (\v|ar{right|
|00006380| 7d 2c 20 5c 76 61 72 7b | 62 6f 74 74 6f 6d 7d 29 |}, \var{|bottom})|
|00006390| 7d 20 69 66 0d 5c 69 66 | 74 65 78 69 0d 5c 63 6f |} if.\if|texi.\co|
|000063a0| 64 65 7b 5c 76 61 72 7b | 6c 65 66 74 7d 20 3c 3d |de{\var{|left} <=|
|000063b0| 20 5c 76 61 72 7b 68 7d | 20 3c 20 5c 76 61 72 7b | \var{h}| < \var{|
|000063c0| 72 69 67 68 74 7d 7d 20 | 61 6e 64 0d 5c 63 6f 64 |right}} |and.\cod|
|000063d0| 65 7b 5c 76 61 72 7b 74 | 6f 70 7d 20 3c 3d 20 5c |e{\var{t|op} <= \|
|000063e0| 76 61 72 7b 76 7d 20 3c | 20 5c 76 61 72 7b 62 6f |var{v} <| \var{bo|
|000063f0| 74 74 6f 6d 7d 7d 2e 0d | 5c 65 6c 73 65 0d 24 5c |ttom}}..|\else.$\|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.